[Gambas-user] Problem with Shell Gambas 3.10.0
Tobias Boege
taboege at gmail.com
Thu Apr 19 20:55:13 CEST 2018
On Thu, 19 Apr 2018, Shannon Kuchler wrote:
> The exec works unless there are spaces in the directory name the in instead of downloading to "my dir" it downloads to "my" which makes me think I need to in close it like this 'my dir' but steamcmd gives me an error same director does not exist unable to write to desk
>
Exec takes everything you give to it literally. If you say
Exec ["ls", "'my dir'"]
then, it will try to list the file 'my dir', including the single
quotes as part of the path. This file doesn't exist, as it tells you.
Single quotes, like spaces, are perfectly legal in a filename and
Exec lets you use them without trying to interpret anything.
Look at this snippet:
Public Sub Main()
File.Save("/tmp/a file with spaces", "")
Exec ["ls", "-Nl", "/tmp/a file with spaces"] Wait
End
Executing it works:
$ ./test.gbs3
-rw-r--r-- 1 user group 0 Apr 19 20:53 /tmp/a file with spaces
And steamcmd doesn't throw up when you invoke it from your interactive
shell, by hand, and use a directory with spaces? If yes, I'm out of ideas.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list