absolute/relative path nightmare

Phil Davis davis.phil at comcast.net
Tue May 24 16:35:11 EDT 2005


Hi Bob,

In each of your examples that don't work, what would happen if you 
prepended the content of 'mycommandline' with a 'cd' to the directory 
where the desired executable lives? Seems like that should make it work, 
since "c:/" may not be the default directory from the Command 
Processor's point of view.

FWIW -
Phil Davis


Bob Hartley wrote:
> Hi All.
> 
> I am completely baffled by this.
> OK I have a script in an app that looks for three files in a folder.
> 
> EG master folder called armbase with an app called armbase.exe
> in folder armbase ther eis a folder called components.
> Within the folder called components ar ethe three files I want to 
> access. One is called armbase.txt one called armbase.xdf and another 
> called PDATconc.exe (I run PDATconv.exe from the shell command.
> 
> OK here is the problem.
> 
> If my script points to the full path eg in this case
> on mouseUp
> 
>   set the hideConsoleWindows to true
>   put "c:\Armbase\Components\PDATconv.exe /I" && quote & 
> "c:\Armbase\Components\Armbase.xdf" & quote into mycommandline
> -- the above is in one line it is just truncated by wordwrap in my email 
> program
>   get shell(mycommandline)
>   put url("file:c:\Armbase\Components\Armbase.txt") into tFile
>   repeat for each line tLine in tFile
> etc etc etc
> 
> Then the script works fine.
> 
> However if I use truncated versions (what I think of as relative paths) 
> the app does not run the externals.
> 
>   set the hideConsoleWindows to true
>   put "Armbase\Components\PDATconv.exe /I" && quote & 
> "Armbase\Components\Armbase.xdf" & quote into mycommandline
> -- the above is in one line it is just truncated by wordwrap in my email 
> program
>   get shell(mycommandline)
>   put url("file:Armbase\Components\Armbase.txt") into tFile
>   repeat for each line tLine in tFile
> 
> or use this version
> 
>   set the hideConsoleWindows to true
>   put "\Components\PDATconv.exe /I" && quote & "\Components\Armbase.xdf" 
> & quote into mycommandline
> -- the above is in one line it is just truncated by wordwrap in my email 
> program
>   get shell(mycommandline)
>   put url("file:\Components\Armbase.txt") into tFile
>   repeat for each line tLine in tFile
> 
> or use this version
> 
>   set the hideConsoleWindows to true
>   put "Components\PDATconv.exe /I" && quote & "Components\Armbase.xdf" & 
> quote into mycommandline
> -- the above is in one line it is just truncated by wordwrap in my email 
> program
>   get shell(mycommandline)
>   put url("file:Components\Armbase.txt") into tFile
>   repeat for each line tLine in tFile
> 
> 
> I thought that if the folder was in the same directory as the app then 
> it would work. I need this to work because it would save lots of 
> problems with running multiple versions.
> 
> Any ideas?
> Cheers
> Bob
> 


More information about the use-livecode mailing list