From: matz@... (Yukihiro Matsumoto) Date: 2000-09-30T00:02:10+09:00 Subject: [ruby-talk:5195] Re: equivalent to Python's os.path? In message "[ruby-talk:5178] equivalent to Python's os.path?" on 00/09/29, Dan Schmidt writes: | |Does Ruby have a module equivalent to Python's os.path? It is useful |for putting together and taking apart pathnames in a |system-independent way. | | Most of os.path functionality is already provided. os.path has the following functions: Function Ruby equivalent ---------------+------------------- abspath File::expand_path basename File::basename commonprefix *1 dirname File::dirname exists File::exist? expanduser File::expand_path expandvars *2 getatime File::atime getmtime File::mtime getsize File::size isabs *1 isdir File::directory? isfile File::file? islink File::symlink? ismount *1 join File::join normcase *3 normpath File::expand_path samefile f.path == f.path sameopenfile f.fileno = f.fileno samestat File::Stat#== *4 split File::split splitdrive *3 splitext File::basename stat File::stat walk Find::find ---------------+------------------- *1 not available, possible to provide in the future. *2 no plan to provide; Ruby has expression substitution. *3 Ruby file API is basically POSIX like; need discussion for system independent API. *4 File::Stat#== compares mtime only. Hope this helps. matz.