I am writing a ruby application (http://speedreader.rubyforge.org/),
where I would like to store some user information to something like
~/.speedreader, and a similar path in windows. I know that in Linux I
can get this path with
Dir.chdir
homewd = Dir.pwd
Does this work in windows too? I have currently no access to a windows
machine.
Martin
Martin Ankerl wrote:
~/.speedreader
Dir.chdir
homewd = Dir.pwd
Does this work in windows too? I have currently no access to a
windows
machine.
Based on my test on a win 2000 system - no.
For windows systems, you might try ENV['USERPROFILE'] + "/Local
Settings/Application Data/" to store your app data. (I suspect more
robust way to determine this path). I don't know if this applies to
other Win versions.
Martin Ankerl wrote:
I know that in Linux I
can get this path with
Dir.chdir
homewd = Dir.pwd
Does this work in windows too? I have currently no access to a windows
machine.
Based on my test on Windows XP, yes.
But you might want to use the following instead:
home_dir = File.expand_path("~")
Regards,
Florian Gross
Florian Gross wrote:
Martin Ankerl wrote:
I know that in Linux I
can get this path with
Dir.chdir
homewd = Dir.pwd
Does this work in windows too? I have currently no access to a windows
machine.
Based on my test on Windows XP, yes.
But you might want to use the following instead:
home_dir = File.expand_path("~")
Regards,
Florian Gross
Neither work on my XP Pro machine, HOME isn't a defined environment variable, though HOME_PATH is, if that means anything.
-- Brian Palmer
Brian Palmer wrote:
Dir.chdir
homewd = Dir.pwd
home_dir = File.expand_path("~")
Neither work on my XP Pro machine, HOME isn't a defined environment variable, though HOME_PATH is, if that means anything.
I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems to be depending on HOME in those code samples. I propose that it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at least on Win32).
Regards,
Florian Gross
Hi,
At Wed, 18 Aug 2004 11:00:56 +0900,
Florian Gross wrote in [ruby-talk:109611]:
I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems to be
depending on HOME in those code samples. I propose that it should
fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at least on Win32).
Now modified in CVS HEAD.
···
--
Nobu Nakada
Hi,
Moin!
I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems to be depending on HOME in those code samples. I propose that it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at least on Win32).
Now modified in CVS HEAD.
Thanks for the quick response.
···
nobu.nokada@softhome.net wrote: