The rename command…
Rashkae
ubuntu at tigershaunt.com
Wed Aug 27 20:27:03 UTC 2008
Johnny Rosenberg wrote:
> 2008/8/27 Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl>
>
>> 2008/8/27 Johnny Rosenberg <gurus.knugum at gmail.com>:
>>
>>> If so, shouldn't that mean that
>>> rename is quite a lot slower than it would be if it was written in, for
>>> example, C, like I think the rest of the Unix/GNU/Linux commands are,
>> such
>>> as mv?
>> For an individual call it is slower, but when renaming many files with
>> one pattern I guess rename would be faster (mv can only rename one
>> file at a time).
>>
>> --
>> Marcin Kowalczyk
>> <qrczak at knm.org.pl>
>>
> But still, if someone "translated" rename to C and compiled it, it would be
> even faster, right? Which should be possible, because the source code for
> rename is available somewhere, isn't it? I don't know, only guessing…
>
prename is just a perl script... the source is the command itself. open
it with a text editor..
Perl is pretty fast at what it does, and perl is written in C. For the
sake of such a small program, it's really not worth doing more. I bet
your filesystem will be slower actually updating the filenames than perl
will be executing 1 string substitution.
More information about the ubuntu-users
mailing list