When executing PHP getcwd() function to get current directory (http://php.net/manual/en/function.getcwd.php), it returns the last folder as Data. For example, running an .exe built by ExeOutput in file structure D:/TEST/PROGRAMS. When executing getcwd(), it returns D:/TEST/PROGRAMS/Data.
Per your documentation when executing your .exe, temp folder “Data” is created (if it does not exist).
So how can I continue to use getcwd() and get the correct current directory?
Obviously I could just PHP strip that Data folder from the end.
Also, saw Main Settings option “Use an absolute path for the virtual “Data” subfolder”. But you can’t chose a relative path?
No, you can’t choose relative paths…
When you run the application, it creates a virtual folder named “Data”: this folder actually doesn’t exist (if you browse to it in Explorer, you won’t find it). It’s just the normal way.
The “Data” subfolder is always located in the same folder as the EXE file.
BTW: you are free to change the current directory to another folder, this won’t stop your application from working.
To do so, use the HEScript function " function SetCurrentDir ( const Dir : string ) : Boolean;"
Thank you for replying.
So how best to handle the php function to return the current directory? Use the HEScript function as you described?
Use the PHP function, it will be faster and easier.
You are sure that the subfolder will always be named “Data” so you can strip that portion of string from the current directory.
Thank you for replying, and your help.