Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Sep 2010 19:01:52 +0100
From:      Arthur Chance <freebsd@qeng-ho.org>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: how to recursively symlink every file in a dir
Message-ID:  <4C892110.9050104@qeng-ho.org>
In-Reply-To: <4C891E66.3010405@qeng-ho.org>
References:  <AANLkTimR9QehTjUrm%2B0CqRVAx=QHkgcfpygrJJfkhbmp@mail.gmail.com> <4C891E66.3010405@qeng-ho.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/09/10 18:50, Arthur Chance wrote:
> On 09/09/10 18:24, Aryeh Friedman wrote:
>> I want to make it so every file is a seperate symlink in dir2 if and
>> only if it is a regular file (not a dir) in dir1... the reason is if
>> the file is unchanged then use symlink but I can rm the symlink and
>> replace it with a non-symlink:
>
> cpio -pdl

Ack! Too quick to answer. That hard links, not symlinks. (Useful in its 
own way though.)

cd $SRCDIR; find . -type d | cpio -pd $DESTDIR

will create the directory structure. Linking the files will have to be 
left as an exercise for the reader as I have to go out. I'd use find for 
the job, but I'm sure someone will come up with some Perl.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C892110.9050104>