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

John Emmas johne53 at tiscali.co.uk
Mon Jun 16 14:51:43 PDT 2008


----- Original Message ----- 
From: "Fons Adriaensen" <fons at kokkinizita.net>
Subject: Re: [Ardour-Dev] GTK+ (concepts and advice)
>
> This means you can 'copy' a file by just creating a new
> entry in a directory - as long as you remain on the same
> partition. The file data itself is not copied
>
Sometime last year I remember Paul and one of the other devs (possibly 
Sampo?) showing me how I could take an entire directory branch (i.e. a 
folder and all its subfolders) and very quickly graft it to some other 
folder - but I hadn't realised that the same was true for copying.
I suppose this raises some obvious questions:-

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?

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?

Thanks,

John



----- Original Message ----- 
From: "Fons Adriaensen" <fons at kokkinizita.net>
To: <ardour-dev at lists.ardour.org>
Sent: 16 June 2008 20:01
Subject: Re: [Ardour-Dev] GTK+ (concepts and advice)


> On Mon, Jun 16, 2008 at 08:19:31PM -0000, John Emmas wrote:
>
>> Interesting....  how complicated is it to use this feature and how much
>> faster is it - and why is "copying" in inverted commas??  :-)
>
> In a Unix filesystem a directory is just a list of
>
> (file-or-directory-name, number).
>
> All information about the file itself is not kept in the
> directory but in a separate list of 'inodes' as they are
> called, which is indexed by the number. There is one such
> list oif inodes for each partition.
>
> This means you can 'copy' a file by just creating a new
> entry in a directory - as long as you remain on the same
> partition. The file data itself is not copied if you do
> this, there is just a new pointer to the inode created.
> The inodes maintain a count of the number of directory
> entries pointing to them. A file is deleted - the disk
> space it occupies is marked as free - if the count becomes
> zero. There is nothing special about the first 'original'
> link which in most cases is the only one. Any other is
> just as good.
>
> These are what is called 'hard' links. There are also
> 'soft' links - these are just a file containing the full
> path name of another one, and treated specially by the
> system.  Soft links exist in Windows as well (called
> 'shortcuts' IIRC), but hard links don't.
>
> -- 
> FA
>
> Laboratorio di Acustica ed Elettroacustica
> Parma, Italia
>
> Lascia la spina, cogli la rosa.
>
> _______________________________________________
> ardour-dev mailing list
> ardour-dev at lists.ardour.org
> http://lists.ardour.org/listinfo.cgi/ardour-dev-ardour.org 




More information about the Ardour-Dev mailing list