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

Lewis Balentine lewis at ...3412...
Sun Dec 14 18:37:27 CET 2014


>> spawns a new process (the shell) which changes its directory (using the cd built-in) to /another/directory and then dies. <<
That is what I expected but I wanted to verify it to before I asked the question.

>> If you want to change the CWD of your process nevertheless, I guess you can use Extern[1] and access the chdir() function in the C
library. <<
I suspect that might be a bit beyond my level of competence at this point.

>> There is no concept of a current working directory in Gambas <<
>> A cleaner solution is to use absolute paths throughout. <<
That is tad inconvenient for what I am trying to do. I want to write a console based application to process a number of files in the directory from which the application is run with no concept of what that directory might be at design time. I was going to use the 'cd' command to change to a target directory for development/testing --- then comment it out afterwards.

>> The CWD from process startup time is found in Application.Dir. <<
I think that can be used as an alternative solution to my problem.

Thank you Tobias.

Lewis






More information about the User mailing list