[Gambas-user] Blanks in filename and path, problems with shell

Benoît Minisini gambas at ...1...
Mon May 31 02:55:57 CEST 2010


> I just make each file name encapsulated with ' eg if i would like to
> use
> 
> /home/steven/My Documents/some.txt
> 
> as a location I would do
> 
> path = "'/home/steven/My Documents/some.txt'"
> 
> and the
> the shell cmd will work correctly like this
> 
> cmd = "gedit " & path
> shell cmd  ....
> 
> remember shell  is just like using bash, so put ' around the paths you
> need to use.
> 
> Sorry I can not give an example with pdftk, but you should be able to
> modify the example to suit you needs.
> 
> 
> Steven
> 

Once again, to send a file path to Shell, you just have to use Shell$() to 
quote it (or Quote.Shell in Gambas 2):

SHELL cmd & " " & Shell$(FirstPath) & " " & Shell$(SecondPath) ...etc.

Regards,

-- 
Benoît Minisini




More information about the User mailing list