[Ardour-Dev] GTK+ (concepts and advice)

Fons Adriaensen fons at kokkinizita.net
Tue Jun 17 02:50:56 PDT 2008

On Tue, Jun 17, 2008 at 10:17:49AM -0000, John Emmas wrote:

> However, this brings up the question of assessing/determining the partition.
> Given only a path to a file, what calls can a programmer use to determine
> which partition it's located on?  Under Windows it's relatively simple
> because partitons are assigned with a drive letter and from a drive letter
> you can get information about the associated volume.  So even if (unusually)
> a given partition was being referenced by 2 different drive letters, you
> could still work out that they're the same partiton.  I assume that's also
> feasible for Linux but maybe a bit trickier?

You could read and parse /etc/mtab.
A better way is to use getmntent() to do this.

But the easiest way out would be to just call link() if you want the
link to be made. It will fail with a specific error code EXDEV if
the link can't be made because the paths are on different filesystems.


Laboratorio di Acustica ed Elettroacustica
Parma, Italia

Lascia la spina, cogli la rosa.

More information about the Ardour-Dev mailing list