Board index » cppbuilder » passing file names with spaces to argv...

passing file names with spaces to argv...


2006-03-05 11:12:59 PM
cppbuilder73
Hi everyone. I have written a little application that will modify a file
in a particular way. It's a command line application and the file to be
modified is passed as an argument to it. The problem is that I call this
file modification application from a GUI application using
createprocess() and when I select a file from a TOpendialog it can
contain spaces in the path which means the path becomes several
arguments. Is there a way to convert the file path so that it does not
contain spaces and still points to the right file? Cheers,
Rory.
 
 

Re:passing file names with spaces to argv...

Two ways. The easiest is to put quotes around the argument. The second way
is to use the short filename version of the file. Look at
ExtractShortPathName in the help.
- Clayton
 

Re:passing file names with spaces to argv...

Cheers, will do.
Rory.
Clayton Arends wrote:
Quote
Two ways. The easiest is to put quotes around the argument. The second way
is to use the short filename version of the file. Look at
ExtractShortPathName in the help.

- Clayton


 

{smallsort}