[Ardour-Dev] GTK+ (concepts and advice)
Fons Adriaensen
fons at kokkinizita.net
Mon Jun 16 14:54:00 PDT 2008
On Mon, Jun 16, 2008 at 09:51:43PM -0000, John Emmas wrote:
> 1) If we have 2 x hard links to a particular file, can they each refer to
> the file by a different name?
>
> 2) Whether they can or they can't can both hard links be in the same
> directory?
If by 'name' you mean the complete path, then of course they
have to be different, otherwise there's only one name.
Apart from that, you can have
/dir1/file.dat
/dir2/file.dat
pointing to the same inode, and hence the same file,
and also
/dir/file1.dat
/dir/file2.dat
can point to the same inode, and the same file.
> 3) Instead of me using fopen/fread on the source file and fopen'fwrite on
> the destination file, what would be involved in creating one of these hard
> links?
On the command line, the commands are 'ln' to create a new link,
and 'rm' to remove one.
>From C, you use
int link (const char *oldpath, const char *newpath);
and
int unlink (const char *path);
both declared in <unistd.h>
Ciao,
--
FA
Laboratorio di Acustica ed Elettroacustica
Parma, Italia
Lascia la spina, cogli la rosa.
More information about the Ardour-Dev
mailing list