Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: file case change

by ChOas (Curate)
on Mar 15, 2002 at 12:26 UTC ( #151966=note: print w/replies, xml ) Need Help??


in reply to Re: file case change
in thread file case change

Okay:
change
for (readdir DIR) { print "$_<br>"; rename("$path/$_", lc("$path/$_")) or print "Couldn't rename $file +: $!\n"; }
to:
for (readdir DIR) { next if (/^\.{1,2}$/); print "$_<br>"; rename("$path/$_", lc("$path/$_")) or print "Couldn't rename $_: $ +!\n"; }

GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;

Replies are listed 'Best First'.
Re: Re: Re: file case change
by tachyon (Chancellor) on Mar 15, 2002 at 20:34 UTC

    This is really bad code. First you lowercase the whole file path ensuring that any uppercase path will break this code (as when you lowercase it you will then try to write along a non existant path). Next you seem to have forgotten that '.' and '..' are not the only directories you might find. Finally you should never print unescaped arbitrary strings in HTML.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://151966]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2016-12-09 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.