1. Change Directory
- Posted by "C. K. Lester" <cklester at yahoo.com> Nov 11, 2002
- 438 views
How do I change the current directory to the directory from which the program executed? I'm looking at command_line()[2] but then I have to parse out the program name. Isn't there just a chdir() command? I don't want to do a system call, either. Although I don't know why not. Anyway... anybody?
2. Re: Change Directory
- Posted by "C. K. Lester" <cklester at yahoo.com> Nov 11, 2002
- 432 views
> > How do I change the current directory to the directory from which the > > program executed? I'm looking at command_line()[2] but then I have to > > parse > > out the program name. Isn't there just a chdir() command? I don't want > > to do > > a system call, either. Although I don't know why not. Anyway... anybody? > > When the program first loads, call built in function [current_dir()] > from [file.e]. This returns a sequence string such as "C:\EUPHORIA\DOC" > if the program was run from there. Save this in a global sequence > (SavedDir) and when you need to reset this call [chdir(SavedDir)] also > from [file.e]. Hey! Thanks Don... Using current_dir() returns "C:" right off the bat, which is wrong! I guess I'll need to parse command_line()[2]... :(
3. Re: Change Directory
- Posted by "C. K. Lester" <cklester at yahoo.com> Nov 11, 2002
- 446 views
> > Hey! Thanks Don... Using current_dir() returns "C:" right off the bat, > > which > > is wrong! I guess I'll need to parse command_line()[2]... :( > > Sorry about that, I dont know why it isnt working correctly. I pasted > this into a dummy program and ran it from four different directories in > three different drives with no issues... > > ===== > include file.e > > printf( 1, "'%s'\n", {current_dir()} ) > atom break > ===== Worked fine for me from whatever directory... problem is: I'm running the program from the UltraEdit program, so I figure my problem is there! That'll be a pain in the butt, having to leave the editor just to run the program. <growl>
4. Re: Change Directory
- Posted by Kat <kat at kogeijin.com> Nov 11, 2002
- 461 views
On 11 Nov 2002, at 10:24, C. K. Lester wrote: > > How do I change the current directory to the directory from which the > program executed? I'm looking at command_line()[2] but then I have to parse > out > the program name. Isn't there just a chdir() command? I don't want to do a > system call, either. Although I don't know why not. Anyway... anybody? I use: junk = chdir("D:\\irc_Tiggr\\Eu webgetter tcp4u\\") Kat