1. Searching for paths
- Posted by bensler at mail.com Feb 25, 2002
- 480 views
Hi all, I need to determine the Euphoria directory, and the Windows directory. I can use get_env() to get %EUDIR and %WINDIR. What if one/both of those don't exist? I can do a walk_dir() search for ex.exe and win.exe(com?), but is that sufficient? Any one computer can have more than one copy of both EU and Windows. What if the file I'm looking for has been renamed? How can I guarantee that I have found the right directories? Would I find win.exe on >win98 ? My plan so far is to check the environment variables, if I can't find them, then I walk_dir() starting from C:\ looking for ex.exe, even if I find it, continue searching to determine if there is a second copy. If I find a second copy, then I can't verify the Euphoria directory, and the user must be prompted for it. Same for WINDIR. I could see this being pretty slow though. Maybe I'm just trying too hard to automate it. My second plan is to just search for the specific directory if the environment variable doesn't exist. Can't find %EUDIR variable, then check if C:\Euphoria exists, if not, prompt the user. Also, is there a simple DOS way of determining the drive letters available? So I can walk the drives as well. Thanx Chris
2. Re: Searching for paths
- Posted by euman at bellsouth.net Feb 25, 2002
- 457 views
I suggest that Euphoria have a link in the registry to indicate where on what disk it can be found. Maybe the new Euphoria installer could do this. Euman euman at bellsouth.net Q: Are we monetarily insane? A: YES ----- Original Message ----- From: <bensler at mail.com> To: "EUforum" <EUforum at topica.com> Subject: Searching for paths > > Hi all, > > I need to determine the Euphoria directory, and the Windows directory. > I can use get_env() to get %EUDIR and %WINDIR. > What if one/both of those don't exist? > > I can do a walk_dir() search for ex.exe and win.exe(com?), but is that > sufficient? Any one computer can have more than one copy of both EU and > Windows. What if the file I'm looking for has been renamed? > How can I guarantee that I have found the right directories? > Would I find win.exe on >win98 ? > > My plan so far is to check the environment variables, if I can't find > them, then I walk_dir() starting from C:\ looking for ex.exe, even if I > find it, continue searching to determine if there is a second copy. > If I find a second copy, then I can't verify the Euphoria directory, and > the user must be prompted for it. > Same for WINDIR. I could see this being pretty slow though. > Maybe I'm just trying too hard to automate it. > > My second plan is to just search for the specific directory if the > environment variable doesn't exist. Can't find %EUDIR variable, then > check if C:\Euphoria exists, if not, prompt the user. > > Also, is there a simple DOS way of determining the drive letters > available? So I can walk the drives as well. > > Thanx > Chris > > > >
3. Re: Searching for paths
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 25, 2002
- 454 views
Chris, are you trying to find out if Euphoria is installed or not? If you are, then you might like to look at the directories in the PATH symbol, looking for ex.exe *and* exw.exe in the same directory. Unless the user has done some serious rearranging of the Euphoria directory structure, you should find ex.exe in a EUPHORIA\BIN directory somewhere on the path. ----- Original Message ----- From: <bensler at mail.com> To: "EUforum" <EUforum at topica.com> Subject: Searching for paths > > Hi all, > > I need to determine the Euphoria directory, and the Windows directory. > I can use get_env() to get %EUDIR and %WINDIR. > What if one/both of those don't exist? > > I can do a walk_dir() search for ex.exe and win.exe(com?), but is that > sufficient? Any one computer can have more than one copy of both EU and > Windows. What if the file I'm looking for has been renamed? > How can I guarantee that I have found the right directories? > Would I find win.exe on >win98 ? > > My plan so far is to check the environment variables, if I can't find > them, then I walk_dir() starting from C:\ looking for ex.exe, even if I > find it, continue searching to determine if there is a second copy. > If I find a second copy, then I can't verify the Euphoria directory, and > the user must be prompted for it. > Same for WINDIR. I could see this being pretty slow though. > Maybe I'm just trying too hard to automate it. > > My second plan is to just search for the specific directory if the > environment variable doesn't exist. Can't find %EUDIR variable, then > check if C:\Euphoria exists, if not, prompt the user. > > Also, is there a simple DOS way of determining the drive letters > available? So I can walk the drives as well. > > Thanx > Chris > > > >
4. Re: Searching for paths
- Posted by akusaya at gmx.net Feb 25, 2002
- 466 views
For windows directory you can use this function... function ambilwindir() = your windows directory object ambilwindir_kernel32 ambilwindir_kernel32 = open_dll("kernel32.dll") object ambilwindir_GetWindowsDirectory ambilwindir_GetWindowsDirectory = define_c_func(ambilwindir_kernel32, "GetWindowsDirectoryA", {C_POINTER, C_LONG}, C_LONG) global function ambilwindir() object hasil, len hasil = allocate_string(repeat(0,254)) len = c_func(ambilwindir_GetWindowsDirectory, {hasil, 255}) return peek({hasil, len}) end function b> Hi all, b> I need to determine the Euphoria directory, and the Windows directory. b> I can use get_env() to get %EUDIR and %WINDIR. b> What if one/both of those don't exist? b> I can do a walk_dir() search for ex.exe and win.exe(com?), but is that b> sufficient? Any one computer can have more than one copy of both EU and b> Windows. What if the file I'm looking for has been renamed? b> How can I guarantee that I have found the right directories? b> Would I find win.exe on >win98 ? b> My plan so far is to check the environment variables, if I can't find b> them, then I walk_dir() starting from C:\ looking for ex.exe, even if I b> find it, continue searching to determine if there is a second copy. b> If I find a second copy, then I can't verify the Euphoria directory, and b> the user must be prompted for it. b> Same for WINDIR. I could see this being pretty slow though. b> Maybe I'm just trying too hard to automate it. b> My second plan is to just search for the specific directory if the b> environment variable doesn't exist. Can't find %EUDIR variable, then b> check if C:\Euphoria exists, if not, prompt the user. b> Also, is there a simple DOS way of determining the drive letters b> available? So I can walk the drives as well. b> Thanx b> Chris
5. Re: Searching for paths
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 26, 2002
- 470 views
----- Original Message ----- From: <bensler at mail.com> To: "EUforum" <EUforum at topica.com> Subject: RE: Searching for paths > > I'm trying to determine the ACTIVELY installed copy of euphoria. Without > relying on environment variables, because for my case, they may not be > initialized yet. > > For example, I have Eu2.3 actively installed, but I also still have my > old eu2.2 directory, still fully intact. That's why I would need to > continue to search for ex.exe even after finding it. > > Chris > I don't know what you mean by ACTIVELY installed. Is this different to INACTIVELY installed? If so, I would have thought that the active Euphoria was the one that was on the PATH. That's why I said to scan the directories in the PATH for ex.exe. If however, ACTIVE means "on disk" then just scan every directory. Also, what do you mean by "continue to search for ex.exe even after finding it". If you've found it, why would you continue to search for it? Or do mean you need to find all files that have the name "ex.exe"? > Derek Parnell wrote: > > Chris, > > are you trying to find out if Euphoria is installed or not? > > > > If you are, then you might like to look at the directories in the PATH > > symbol, looking for ex.exe *and* exw.exe in the same directory. Unless > > the > > user has done some serious rearranging of the Euphoria directory > > structure, > > you should find ex.exe in a EUPHORIA\BIN directory somewhere on the > > path. > > > > ----- Original Message ----- > > From: <bensler at mail.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Tuesday, February 26, 2002 5:49 AM > > Subject: Searching for paths > > > > > > > Hi all, > > > > > > I need to determine the Euphoria directory, and the Windows directory. > > > I can use get_env() to get %EUDIR and %WINDIR. > > > What if one/both of those don't exist? > > > > > > I can do a walk_dir() search for ex.exe and win.exe(com?), but is that > > > sufficient? Any one computer can have more than one copy of both EU and > > > Windows. What if the file I'm looking for has been renamed? > > > How can I guarantee that I have found the right directories? > > > Would I find win.exe on >win98 ? > > > > > > My plan so far is to check the environment variables, if I can't find > > > them, then I walk_dir() starting from C:\ looking for ex.exe, even if I > > > find it, continue searching to determine if there is a second copy. > > > If I find a second copy, then I can't verify the Euphoria directory, and > > > the user must be prompted for it. > > > Same for WINDIR. I could see this being pretty slow though. > > > Maybe I'm just trying too hard to automate it. > > > > > > My second plan is to just search for the specific directory if the > > > environment variable doesn't exist. Can't find %EUDIR variable, then > > > check if C:\Euphoria exists, if not, prompt the user. > > > > > > Also, is there a simple DOS way of determining the drive letters > > > available? So I can walk the drives as well. > > > > > > Thanx > > > Chris > > > > > > > > >
6. Re: Searching for paths
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Feb 28, 2002
- 469 views
For finding what drives are on a system, Al Getz has some code in the archives: http://www.rapideuphoria.com/getdrive.zip it's written as a windows program, but the drive functions can easily be abstracted; it gives *all* drives on system, but you can also easily make it just return hard disk drives. Does say "--requires Windows 95 OEM Service Release 2 (OSR2) or above.", so it might not work on all systems? Dan Moyer ----- Original Message ----- From: <bensler at mail.com> To: "EUforum" <EUforum at topica.com> Sent: Monday, February 25, 2002 10:49 AM Subject: Searching for paths > > Hi all, > > I need to determine the Euphoria directory, and the Windows directory. > I can use get_env() to get %EUDIR and %WINDIR. > What if one/both of those don't exist? > > I can do a walk_dir() search for ex.exe and win.exe(com?), but is that > sufficient? Any one computer can have more than one copy of both EU and > Windows. What if the file I'm looking for has been renamed? > How can I guarantee that I have found the right directories? > Would I find win.exe on >win98 ? > > My plan so far is to check the environment variables, if I can't find > them, then I walk_dir() starting from C:\ looking for ex.exe, even if I > find it, continue searching to determine if there is a second copy. > If I find a second copy, then I can't verify the Euphoria directory, and > the user must be prompted for it. > Same for WINDIR. I could see this being pretty slow though. > Maybe I'm just trying too hard to automate it. > > My second plan is to just search for the specific directory if the > environment variable doesn't exist. Can't find %EUDIR variable, then > check if C:\Euphoria exists, if not, prompt the user. > > Also, is there a simple DOS way of determining the drive letters > available? So I can walk the drives as well. > > Thanx > Chris >
7. Re: Searching for paths
- Posted by euman at bellsouth.net Feb 28, 2002
- 470 views
----- Original Message ----- From: "Dan Moyer" <DANIELMOYER at prodigy.net> To: "EUforum" <EUforum at topica.com> Subject: Re: Searching for paths > > For finding what drives are on a system, Al Getz has some code in the > archives: > http://www.rapideuphoria.com/getdrive.zip > > it's written as a windows program, but the drive functions can easily be > abstracted; it gives *all* drives on system, but you can also easily make > it just return hard disk drives. > > Does say "--requires Windows 95 OEM Service Release 2 (OSR2) or above.", so > it might not work on all systems? > > Dan Moyer Hey Dan, Chris everyone following this thread Here's my solution to finding what drives are on a system I posted this 7 Nov 2001 http://www.rapideuphoria.com/cgi-bin/msearch.cgi?fromMonth=6&fromYear=1&toMonth=2&toYear=7&postedBy=Euman&keywords=xGetLogica lDriveStrings Hope it helps Euman euman at bellsouth.net Q: Are we monetarily insane? A: YES >