The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Redefining File methods

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
Redefining File methods Posted: May 25, 2005 12:42 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: Redefining File methods
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
Well, it looks like the proposed Pathname changes are dead. Wah.

One good thing to come out of it, however, is that Austin Ziegler rightly pointed out that File.basename and File.dirname don't work properly on Win32 with regards to UNC paths.

Well, if I can't fix Pathname, at least I can fix the File methods. So, as of today's release of the win32-file package (0.4.3) those methods work properly. There are now a total of six* methods I've had to define or redefine to make them work properly:

* File.size - current implementation doesn't handle file sizes > 2 GB
* File.chardev? - current implementation (falsely) always returns false
* File.blockdev? - ditto
* File.basename - UNC paths not handled properly
* File.dirname - ditto
* File::Stat.blksize - not implemented in core Ruby for Win32

The big one still left, however, is File.stat, which only partially works on Win32 systems because it uses the 'etc' package internally (which doesn't work on Windows). So, some of the File::Stat struct members contain bogus information, or no information at all.

Onward.

* Ok, technically it's +seven+ methods. I don't count File.path, however, because I redefined it for internal reasons only, and the behavior is identical.

Read: Redefining File methods

Topic: David Siegel wants to build his film app in Rails Previous Topic   Next Topic Topic: One-Click Ruby Installer hits 90k (plus OSX news)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use