PDA

View Full Version : Printing and setting current working directory



dco045
09-12-2020, 02:04
Hi, :friends:

I am searching a function to know the current working directory of a bundled exe, :?:
and also a function to force a new value for current working directory.


Thanks for help


Dany

Petr Schreiber
14-12-2020, 00:05
Hi Dany,

I usually prefer to compose the absolute paths, using APP_ScriptPath to retrieve the directory where the script lives and then work with that further.

For example, if your EXE is "c:\myprograms\mycool.exe", then APP_ScriptPath will contain "c:\myprograms\"


Petr

dco045
14-12-2020, 12:14
Hi Petr,

My long Unix / C background leads me to use a syscall/function to set a current workig directory.
There,all manipulation of files needs only to know the relative file name instead of rebuilding complete file path.

Yes, I know I'm lazy. :lazy: :lazy:

Dany

Petr Schreiber
14-12-2020, 21:26
Hi Dany,

I see & understand :)

Then these will be at your service:

DIR_GetCurrent
DIR_Change


Please note you need to do uses "file" to be able to use these.


Petr

dco045
14-12-2020, 23:24
Hi Dany,

I see & understand :)

Then these will be at your service:

DIR_GetCurrent
DIR_Change


Please note you need to do uses "file" to be able to use these.


Petr

Hi great Petr,


Exactly what I was looking for.... But I was searching in "FILE_****" or "OS_***" functions. :drink:

Lot of thanks.

Dany