[Gambas-user] Shell command including string containing a quote
Tobias Boege
taboege at ...626...
Tue Jan 29 17:28:13 CET 2013
On Tue, 29 Jan 2013, John Rose wrote:
> Tobias,
>
> Thanks for that useful reply.
>
> I have a quick question (it doesn't seem worth asking on the Mailing List):
> Using Dialog.OpenFile(), the resulting Dialog.Path shows the full path
> to the file (e.g. /home/john/x.txt). Given that the runtime user might
> change to a different directory (from that specified in Dialog.Path -
> /home/john/ - as a prior command to Dialog.OpenFile()) how can I obtain
> the new directory (e.g. /home/john/abc/) easily? I thought of using a
> string function to select characters before the final slash character
> but then the filename might contain a slash....
Mmm. I hope I understood you correctly: you want to get the directory part
of a path? The File class has some useful static functions for path
manipulation.
The right one for this case could probably be File.Dir(). Try out if it fits
your needs. Especially your last sentence makes me wonder...
Regards,
Tobi
More information about the User
mailing list