develooper Front page | perl.perl5.porters | Postings from October 1999

Re: [ID 19991018.001] Perl function "rename oldname, newname" eats network files

From:
Chaim Frenkel
Date:
October 29, 1999 10:04
Subject:
Re: [ID 19991018.001] Perl function "rename oldname, newname" eats network files
Message ID:
m3wvs6umjn.fsf@chany-p100.emwp.com
If you think about it. It has to be a M$ bug. Why should perl care how many
renames it has done or how many files there are in a directory.

I've recently had to rewrite some ftp code that I had been running. The
file was transfered under a temproary name and then renamed to the final
name. But depending upon the current configuration of stars, a random 
number of files would not show up in the remote machine.

So using that tried and true debuggin mechanism I tried some voodoo
programming and altered the algorithm to avoid the rename. Lo and
behold no complaints in two months.

Isn't voodoo programming fantastic.

<chaim>

>>>>> "DA-" == D'ANDREA Andy -NUCLEAR <andy.d.andrea@ontariopowergeneration.com> writes:

DA-> This is a bug report for perl from andy.d.andrea@ontariopowergeneration.com,
DA-> generated with the help of perlbug 1.26 running under perl 5.00503.

DA->  The "rename oldname, newname" function was being used to rename all files
DA->  in a directory that were named in lowercase or a lower/uppercase mix to all
DA->  uppercase.

DA->  The following code stops when the rename fails the first time. This code is
DA->  being run on a networked NT 4 system. The problem occurs when running the
DA->  script on a network directory containing about 20 files having lower case
DA->  character in their names. It doesn't seem to be a problem if working on a
DA->  local hard disk.

DA->  The file being worked on when rename fails is deleted from the filesystem!

DA->  Please let me know if fixed patch exists.

-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
chaimf@pobox.com				               +1-718-236-0183



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About