[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-devel-list
Subject:    Re: [Mono-dev] Help needed with UnixDriveInfo
From:       Jonathan Pryor <jonpryor () vt ! edu>
Date:       2006-05-25 11:06:17
Message-ID: 1148555179.30938.3.camel () melchior ! magi
[Download RAW message or body]

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


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic