From: Daniel Berger Date: 2009-02-27T06:37:29+09:00 Subject: Re: sys-filesystem interface advice On Feb 23, 11:43 am, Daniel Berger wrote: > Hi, > > I'm going to add the Filesystem.mount_point method. It will simply > return the mount point associated with the given file. > > Example: > > Filesystem.mount_point('/home/djberge/foo.txt') # => '/home' (RHEL > Linux) > > My dilemma is what I should do when I can't find an associated mount > point. For example, the device number for '/dev' on our RHEL box at > work doesn't match the device number of any of the mount points. > > Which of these options seems most appropriate? > > 1 - Return nil > 2 - Return '/' > 3 - Return itself, e.g. '/dev' would return '/dev' > 4 - Raise an error > > Suggestions? Well, since no one chimed in, I went with "returns itself". BTW, I've released sys-filesystem 0.3.0, which now includes support for FreeBSD and OS X. Thanks go to Nobuyoshi Miyokawa for that. Regards, Dan