From: Mark Hahn Date: 2002-01-02T08:37:54+09:00 Subject: [ruby-talk:29995] Re: How to check free diskspace? > Yes, but I wonder, is this just something that cygwin is doing for us and when we start distributing Ruby binaries compiled with MSVC++ will we lose this feature? This worked on ruby 1.6.5 compiled in an msvc project: p File.new('c:/autoexec.bat').atime # => Fri Jun 08 15:26:16 GMT-8:00 2001 -----Original Message----- From: Phil Tomson [mailto:ptkwt@shell1.aracnet.com] Sent: Tuesday, January 01, 2002 2:25 PM To: ruby-talk ML; undisclosed-recipients: Subject: [ruby-talk:29993] Re: How to check free diskspace? In article , Michael Kelly wrote: >On Tue, 01 Jan 2002 00:54:18 GMT, Rik Hemsley wrote: > >>Blame POSIX for not defining something useful... or not, because it's >>pretty hard to come up with something generic. > >Seems like it would be a good area for a library module >to make a generic interface to platform specific functions. >As example Python has os.path module where 'path' >just drags in the correct module for the platform, be >it NT or Linux or whatever, and does stuff like join >and split parts of file paths using the correct >directory separator chars, glob files in a >directory, get free disk space, file sizes >and types etc.. so that the source of >the script using the os.path module is >the same. Sounds like a good candidate for a module to convert to Ruby. But how does it handle drive letters on Windows vs mount points on Unix? I guess I'm thinking of something like Samba does, you can specify paths like: //samba_drive and it gets mapped to, say, drive Z: So, on Unix the path is something like: /samba_drive/blah/blah but on Windows it's : Z:\blah\blah How can I map between /samba_drive and Z: depending on which platform I'm on? (I've used environment variables to do this, but maybe there's a better way). It might be nice if there was some way to check out the drive mappings under windows and then map /samba_drive/blah/blah to Z:\blah\blah on Windows (of course it would have to be some kind of special platform independent path object) > >btw-I'm new to Ruby but one thing I *love* about >it that is sort of related is the auto conversion of >string constants for file paths, so in Win32 I can >put "d:/Program Files/MyApp.exe" instead of >the double-backslash bit "d:\\Program Files\\MyApp.exe" >A nice touch. Yes, but I wonder, is this just something that cygwin is doing for us and when we start distributing Ruby binaries compiled with MSVC++ will we lose this feature? I don't think its somthing that Ruby is doing.(something to keep in mind for that transistion) Phil