Re: [netatalk-admins] Option to disable AppleDouble


Subject: Re: [netatalk-admins] Option to disable AppleDouble
From: Duncan Sinclair (sinclair@dis.strath.ac.uk)
Date: Fri Sep 17 1999 - 14:58:45 EDT


Hi,

There is a very important point to understand about using "xargs"
and "find" in the context on netatalk.

If any files or directories you are searching have spaces, you
could lose badly.

If you have GNU find and GNU xargs, you want to check the "-print0"
option of find and the "-0" option of xargs.

The alternative way using "-exec" does avoid this problem, at the
expense of the time taken to do each fork&exec. I think that GNU
find may also have a "-rm" option - this, I guess, would be the
fastest way.

Cheers,

Duncan Sinclair.

>> find is more powerful than that, you can combine the two instructions in only
>> one like this
>>
>> find /path/to/apple/share -type d -name .AppleDouble -exec /bin/rm -R {} \;
>>
>> find /path/to/apple/share -type d -name .AppleDouble | xargs /bin/rm -R

>ok.. I don't think netatalk-admins is the place to start discussing the
>good/bad parts of using -exec vs. using | xargs.

>As a homework assignment, you can try both commands and see which one is
>faster :)

>Tim



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:17:14 EST