[Mono-dev] Help needed with UnixDriveInfo
Jonathan Pryor
jonpryor at vt.edu
Thu May 25 07:06:17 EDT 2006
On Wed, 2006-05-24 at 16:39 +0300, Petri Latvala wrote:
> On Wed, May 24, 2006 at 07:36:47AM -0400, Jonathan Pryor wrote:
> > In general, you don't, since a mount point can be anywhere...
>
> As a side note, it is quite trivial. One can check whether somedir is
> a mount point by stat()ing somedir and somedir/.. and comparing their
> device (st_dev). Or by checking whether somedir and somedir/.. point
> to the same inode on the same device.
I think you misunderstood the original question. To quote the original:
> I would like to try UnixDriveInfo but I can not know how to start. As
> I can see to construct a UnixDriveInfo object I have to give a mount
> point. How can I get the mount point part of a path?
In other words, given the path /foo/bar/baz, what part of that path is
the mount point? Is it the / mount? The /foo/
mount? /foo/bar? /foo/bar/baz?
In principal, it could be _any_ of those, so you _can't_ tell which part
of the path is the mount point without extra work (such as checking all
parent directories for their device and comparing, as you suggested, or
by comparing mount points as I did in the previous email).
- Jon
More information about the Mono-devel-list
mailing list