At Wed, 27 Mar 2002 14:01:00 +1100, Jeff Waugh wrote: > So using cp -lr is a very effective way to speed up and save space when > patching very large codetrees, but I'm interested in what's going on > beneath. > > When patch changes a hard linked file, it relinks it so that it becomes a > new file (reference to an inode). I'm assuming it does this explicitly, > because hard links would be pretty useless if it didn't. :-)
nothing magic. its removing the old file before writing the new file. anything that doesn't do this needs a good beating. (my (un)favourite offender is tar. many a time did i hose my ancient non-debian system by untaring a binary libc distribution over a running system and have it merrily overwrite currently-being-demand-paged libraries. by unlinking first, everything would have been good). and no, you can't really do this transparently - at least, not without playing dodgy LD_PRELOAD games. -- - Gus -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
