File.expand_path(file_name [, dir_string] ) â abs_file_name
Class Public methods
Converts a pathname to an absolute pathname. Relative paths are referenced
from the current working directory of the process unless
dir_string is given, in which case it will be used as the starting
point. The given pathname may start with a â~
'', which
expands to the process owner's home directory (the environment variable
HOME
must be set correctly).
â~
user'' expands to the named user's home
directory.
1 2 | File .expand_path( "~oracle/bin" ) #=> "/home/oracle/bin" File .expand_path( "../../bin" , "/tmp/x" ) #=> "/bin" |
Please login to continue.