Afficher un message
Vieux 14/09/2007, 14h03   #8
Olivier Renaud
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Cross-platform Home Directory?

Trans a écrit :
> I have a little app that needs to store session data. I assume the
> best place to store it is in one's home directory, but I need this app
> to be cross-platform. I glanced through all rbconfig.rb's
> Config::CONFIG settings but did not see anything for it. How does one
> access a cross-platform home directory?
>
> Thanks,
> T.
>

This is how I do this :
home_directory = Dir.chdir {|path| path}

The doc for Dir.chdir says that without argument, this method looks for
environnement variables HOME or LOGDIR. And with a block, the directory
is changed only inside the block, and restored right after.

--
Olivier Renaud

  Réponse avec citation
 
Page generated in 0,05175 seconds with 9 queries