10:57:49 Perl Open E:\GMS\TESTMEMBER\GMS.LOG
10:57:49 Perl Open E:\GMS\TESTMEMBER\GMS.LOG
10:57:49 Perl Close E:\GMS\TESTMEMBER\GMS.LOG
10:58:10 Perl Rename E:\GMS\TESTMEMBER\GMS.LOG
You open GMS.LOG twice, only close it once, then try to
rename it (when you still have it open at least once).
The default for C programs under Win32 is to allow "read"
and "write" sharing but not "delete" sharing. And if a
file is currently open w/o "delete" sharing having been
requested, then no one (not even the process that has the
file open) is allowed to delete or even rename the file.
So you need to find which of your two file handles you
are failing to close before you rename the file.
FYI, Win32API::File has more information on
Win32 file sharing and ways to open files while specifying
different levels of file sharing.
Elsewhere you asked about the "archive" bit. If the
archive bit is set, that means that a file has been
modified since the last time it was archived. That is,
modifying the contents of a file sets the archive bit
and many "backup" programs clear the archive bit when they
copy the file. Also, many backup programs can be told to
only backup files who have the archive bit set (which is
where this whole scheme becomes useful).
-
tye
(but my friends call me "Tye") |