finding current working directory

TColeman

Member
I am writing output to a file and I want the file to be placed in the current working directory (the directory the application is located). How do I do that without hard coding the location? I am starting the application from a shortcut on the desktop, so the text file I am writing to gets saved in PROGRESS/bin.

Thanks, Terri
 
Hi there Terri,

I use the following code. It will return the working directory that is specified on the icon that you double-click (or the location of the executable file that you double-click on).

/* Assign the current directory as the file you want to query */
FILE-INFO:FILE-NAME = ".".
DISPLAY FILE-INFO:FULL-PATHNAME FORMAT "x(60)" LABEL "Full Path".

I think the code was something I found in the progress help files.

HTH,

James.
 
Have you set the startup directory of your shortcut to the application directory?

If so that's where all output should go, otherwise the default when you create a shortcut is the location of the executable.

HTH

Rich
 
Back
Top