Re: current_dir()
- Posted by Juergen Luethje <j.lue at gmx.?e> Aug 08, 2007
- 575 views
Jules wrote: > Juergen Luethje wrote: > > > > Jules wrote: > > > > <snip> > > > > > Thanks Don, but it didn't make any difference. Actually, I'm a little > > > confused > > > about what current_dir() refers to, because you can have more than one > > > "current > > > directory". On XP and Linux you could have any number of shells open, each > > > one > > > running from a different directory. I thought that current_dir() gives you > > > the > > > dir which the Eu program is running from. > > > > > > Please could someone set me straight on this? > > > > When you open a command window (console) on Windows, and it shows say > > C:\Programs> > > then "C:\Programs" is the current directory. The definition of the > > current directory has nothing got to do with the question where your > > Eu program is located. I think it's the same on Linux. > > > > When your program "my.exw" is located in the current directory, then > > the command-line for starting it can be as simple as: > > exw my.exw > > When your program is _not_ located in the current directory, then > > you have to pass its full pathname (surrounded by quotes if it contains > > spaces) to the Eu interpreter, e.g. > > exw "D:\my files\test\my.exw" > > > > Regards, > > Juergen > > Ok thanks Juergen. I was trying to write a program which would "find itself" > as it were, and I thought current_dir() would be a way to do it. No, the desired information is contained in the return value of command_line(). Please see the documentation of command_line() for details. > But going back to my point about consoles (sticking with Windows), I can open > a console and CD to c:\euphoria, then open another and CD to c:\windows... so > which is the current directory in this case? I'm not 100% sure, but I think that actually each console window has its own current directory. However, I personally can't remember that I ever had the need to use current_dir() in one of my programs. Regards, Juergen