![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread[>>]
Number : 5273 Date : 2003-08-11 Author : Garry Deane Subject : Re: Copy failed using /RCY/R to overwrite Read-Only file in destination Size(KB) : 2
--- In xxcopy@yahoogroups.com, "dayvah49" wrote: > My initial thoughts were the same as yours that it must be > a file in use problem. But the four read-only files that > caused the original problem are related to a firmware update > for my cd burner drive and are not in use. They are not even > installed at this time. The two files I used for my test, > one in source and one in destination, are newly made simple > .txt files that have the same name and the same size. Both > have just the read-only bit checked and neither file is > in use. I ran the test to exclude files in use as the > obvious cause for "copied failed" with /oe3 added as you > suggested. See the results below. > I'm stumped, any other ideas? > > =========================================================== > XXCOPY ver 2.84.9 2003-08-10 00:44:57 Windows Ver 4.10.2222 > Command Line = C:\WINDOWS\COMMAND\XXCOPY.EXE "h:\xxtest\test_1 > \" "h:\xxtest\test_2\" /ks/rcy/ed/pd0/s/h/r/y/oe3/oa:i:\xxerr.log > ----------------------------------------------------------- > Source base directory = "H:\xxtest\test_1\" > Destination directory = "H:\xxtest\test_2\" > File name template = "*" > H:\xxtest\test_1\test.txt > Copy failed > ----------------------------------------------------------- > Summary of Errors > ## Error 5 ## Access is denied > H:\xxtest\test_1\test.txt > ----------------------------------------------------------- I have now been able to duplicate the problem (not sure what I did differently yesterday). The trigger is having the file already in the destination with the RO bit set. Xxcopy is failing to delete/overwrite the destination so fails the operation. I think this is a bug. IIRC /RC was grafted into xxcopy as something of an afterthought to the /RS, /RD commands. Kan will need to look into it. In the meantime, the quick fix is to remove the /KS switch which will clear the RO bit when the file is copied to the destination. Subsequent copies will be able to overwrite the file as required. If the destination is your reference directory, the RO bit won't be significant. If the destination is your backup and you want/ need to keep the attributes, you may need to add an extra step to copy first then delete the source files. This will probably require playing with the archive bit - set all on; copy and clear archive bit (/M); copy and delete files with the archive bit set with /RCY, /K0 and /TR0 to your reference directory. Note that you will need to clear the RO bit in the reference directory first. Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.