CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
Rename files.



Jan 28, 2000, 3:20 PM

Post #1 of 2 (5264 views)
Rename files. Can't Post

I made a user database, all the passwords
are encrypted but as an extra little
thing to add the secure features
I am trying to have perl rename the database
every hour. Is this possible? I've
seen it done if the file is a day old
it will delete it so I assume this is possible.

Enthusiast / Moderator

Jan 28, 2000, 6:31 PM

Post #2 of 2 (5264 views)
Re: Rename files. [In reply to] Can't Post

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

# if the file is over a day old
if (-M $filename > 1) {
# create new filename, and remove any
# /'s that crypt() might put in there
($newname = crypt(rand, rand time)) =~ tr!/!!d;

rename $filename => $newname or die "can't rename $filename to $newname: $!";

Just figure out a way to keep track of what that file is called. Smile


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives