← Back to team overview

coapp-developers team mailing list archive

Re: Ptk exception

 

LOL

If someone is dippy enough to put a semicolon in a folder name, they deserve to be smacked. Hard. Repeatedly.

I've updated the GetFullPath() extension method to trim quotes (something I should have done a long time ago)

G


From: Trevor Dennis [mailto:trevor@xxxxxxxxxxxxx]
Sent: Thursday, June 09, 2011 8:10 AM
To: 'Eric Schultz'; Garrett Serack
Cc: 'coapp-developers'
Subject: RE: [Coapp-developers] Ptk exception

Hi,

Semi-colons are also valid path characters, so splitting on the ';' in the string may not be valid.  You'll need to ignore the semi-colons within the quoted paths.

(not that anyone should be crazy enough to put semi-colons in their folder names).

Trev.


From: coapp-developers-bounces+trevor=dennis-it.com@xxxxxxxxxxxxxxxxxxx [mailto:coapp-developers-bounces+trevor=dennis-it.com@xxxxxxxxxxxxxxxxxxx] On Behalf Of Eric Schultz
Sent: Thursday, June 09, 2011 8:19 AM
To: Garrett Serack
Cc: coapp-developers
Subject: Re: [Coapp-developers] Ptk exception

One of my search paths had double quotes around it. That is acceptable to Windows and it handles it properly but Path.GetFullPath doesn't like it I guess.


Now I get the following exciting error when it tries to find git:

C:\Users\Eric\Desktop\bzip2-1.0.6>ptk build
CoApp Project pTk Version 1.0.3.1573 for x64
Copyright (c) Garrett Serack, CoApp Contributors 2010-2011. All rights reserved
CoApp portingToolkit for porting apps
-------------------------------------------------------------------------------
[One moment.. Scanning for utility(git.cmd/none/0.0)]

Unhandled Exception: System.AggregateException: One or more errors occurred. ---
> System.Exception: Invalid DOS header. C:\Program Files (x86)\Git\cmd\git.cmd
   at CoApp.Toolkit.Win32.PEInfo..ctor(String filename) in C:\Users\Eric\coapp1\
toolkit\Win32\PEInfo.cs:line 204
   at CoApp.Toolkit.Win32.PEInfo.Scan(String filename) in C:\Users\Eric\coapp1\t
oolkit\Win32\PEInfo.cs:line 157
   at CoApp.Toolkit.Utility.ProgramFinder.<>c__DisplayClassa.<ScanForFile>b__4(S
tring file) in C:\Users\Eric\coapp1\toolkit\Utility\ProgramFinder.cs:line 106
   at System.Linq.Parallel.WhereQueryOperator`1.WhereQueryOperatorEnumerator`1.M
oveNext(TInputOutput& currentElement, TKey& currentKey)
   at System.Linq.Parallel.PipelineSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDis
pose)
   at System.Linq.Parallel.AsynchronousChannelMergeEnumerator`1.MoveNextSlowPath
()
   at System.Linq.Parallel.QueryOpeningEnumerator`1.MoveNext()
   at CoApp.Toolkit.Extensions.LinqExtensions.MaxElement[T,U](IEnumerable`1 sour
ce, Func`2 selector) in C:\Users\Eric\coapp1\toolkit\Extensions\LinqExtensions.c
s:line 32
   at CoApp.Toolkit.Utility.ProgramFinder.ScanForFile(String filename, Executabl
eInfo executableType, String minimumVersion, IEnumerable`1 filters) in C:\Users\
Eric\coapp1\toolkit\Utility\ProgramFinder.cs:line 114
   at CoApp.Ptk.pTkMain.main(IEnumerable`1 args) in C:\Users\Eric\coapp1\ptk\pTk
Main.cs:line 290
   at CoApp.Ptk.pTkMain.Main(String[] args) in C:\Users\Eric\coapp1\ptk\pTkMain.
cs:line 87

On Thu, Jun 9, 2011 at 8:53 AM, Garrett Serack <garretts@xxxxxxxxxxxxx<mailto:garretts@xxxxxxxxxxxxx>> wrote:
In ProgramFinder.AddPathsToList() add this at the top of the function:

    foreach (var p in Environment.ExpandEnvironmentVariables(paths).Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) {
        Console.WriteLine(p);
    }

And tell me what you see... something has got an illegal character in some search path

From: coapp-developers-bounces+garretts=microsoft.com<http://microsoft.com>@lists.launchpad.net<http://lists.launchpad.net> [mailto:coapp-developers-bounces+garretts<mailto:coapp-developers-bounces%2Bgarretts>=microsoft.com<http://microsoft.com>@lists.launchpad.net<http://lists.launchpad.net>] On Behalf Of Eric Schultz
Sent: Thursday, June 09, 2011 6:08 AM
To: coapp-developers
Subject: [Coapp-developers] Ptk exception

I've been having this problem with ptk in previous versions and now no matter what I do. It clearly works for others so I'm not sure what's going on. Anytime I run ptk, I get an exception which I've attached to this message. Also, I've attached the input file. (Yes this was to make a fork of bzip2 before I realized Garrett had already done that but the problem happens either way :)

Eric


References