[Gambas-user] File & Directory Functions: PWD, cd

Benoît Minisini gambas at ...1...
Sun Dec 14 19:09:45 CET 2014


Le 14/12/2014 17:54, Lewis Balentine a écrit :
> I can find out what the current directory is with:
>       Print Application.Env["PWD"]
>
> However there does not seem to be anything to change the present working
> directory within the "File & Directory Functions".
> I did try using the shell function. It did not seem to have the desired
> effect.
>         Print Application.Env["PWD"]
>         Shell ("cd /mnt/Data/videos")
>         Wait 0.1
>         Print Application.Env["PWD"]
> ----------
>       /home/lewis
>       /home/lewis
>
> So I guess that I have missed something obvious again.
> How does one change the current directory in a Gambas console based
> program ?
>
> Thank you,
>
> Lewis
>

To run a child process in a specific working directory, do that:

EXEC [ ... ] WITH [ "PWD=/the/directory" ]

Regards,

-- 
Benoît Minisini




More information about the User mailing list