DragonFly kernel List (threaded) for 2008-02
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: Globbing
Oliver Fromme wrote:
Simon 'corecode' Schubert wrote:
> Oliver Fromme wrote:
*snip* good stuff, in archives if need...
I has said I'd wiki-fy this but since it contines here ..
what I had in mind is simple, and two-fold:
First, that the use of a naked '*' as in either;
rm *
or
rm -Rf *
. . will both always be special cases of 'globbing', as neither pattern
matching nor list-building is actually needed.
All we want done is to zero-out the entries, much as if we were
newfs'ing a subdir instead of a partition.
Code that could recognize that special case and act accordingly should
be blitzen fast and need very little in the way of wall-clock time, I/O
or CPU resources. As said earlier, it just bitch-slaps the inode(s) into
amnesia.
Second, in the more general case of complex pattern matching:
I'd want to add a command-tail switch that told rm (and friends) to drop
into a repetitive batch mode, wherein the 'chunk' size presumed
longest-possible file names, queried the environment w/r buffer size,
and operated on no more than the number of entries at a time than could
be expected to fit into, say half the known/expected resource set.
A brand-new switch does not interfere with any legacy behaviour - which,
as we have seen, *must* be preserved.
Now - I expect that this would be *slower* than many/all of the 'xargs'
and similar options so far cited - and that an expert would usually
elect to utilize any of the several other methods.
No problem with that. Nothing has gone away.
But - slow or not, and keeping in mind how downright deadly 'rm' can be
in *any* form, I don't see it as any MORE dangerous than any other method.
Au contraire - slow or not, it should be less subject to keying or
'headspace' error than is opened up in the other parts of the scripts so
far submitted. The more characters, the greater the chance of error.
But just what the Doctor ordered for busy admins who need to do this too
seldom to want to wander off into interpreters OR clever scripts...
IOW - BFBI approach. Brute Force and Bloody Ignorance. It JFW.
Unreasonable? Perhaps.
But Google 'progress and unreasonable'
Best,
Bill
- References:
- Re: Globbing
- From: Oliver Fromme <check+jw8ofi00rs0jv7gg@fromme.com>
- Re: Globbing
- From: Rahul Siddharthan <rsidd120@gmail.com>
- Re: Globbing
- From: Bill Hacker <wbh@conducive.org>
- Re: Globbing
- From: Oliver Fromme <check+jw9s6d00rssc8bjn@fromme.com>
- Re: Globbing
- From: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
- Re: Globbing
- From: Oliver Fromme <check+jwa3p800rsnjg5ac@fromme.com>
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]