Modify

#170 closed Bug (No Bug)

FileCopy unable to copy new files when source files number excess 10k

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: Cc:

Description

When using filecopy with wildcard, like
FileCopy ("X:\*.bin", "C:\Program Files\test")
If source folder contains more than 10000 files, it will run but wouldn't copy any files to the target folder.

Attachments (0)

Change History (7)

comment:1 by Jos, on Mar 15, 2008 at 9:01:40 AM

This script runs fine for me:

DirCreate("C:\temp\test1")
FileChangeDir("C:\temp\test1")
For $x = 1 To 10005
	FileWriteLine($x & ".txt",$x)
Next
FileCopy("C:\temp\test1\*.*","C:\temp\test2\*.*",1+8)
$FileCnt = DirGetSize("C:\temp\test2",1)
ConsoleWrite(" Files in C:\temp\test2:" & $FileCnt[1] & @CRLF)

It creates 10005 files in a directory and then copies them to a new directory.
Are you sure that none of the files is in use since FileCopy will stop processing when that happens.

Autoit3:3.2.10.0 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 2 CPU:X86)

comment:2 by Jpm, on Mar 18, 2008 at 12:51:20 PM

I confirm Jos diagnostic
No bug under XP/Sp2

comment:3 by Jpm, on Mar 18, 2008 at 12:51:51 PM

Resolution: No Bug
Status: newclosed

comment:4 by Nitrogen, on Apr 12, 2008 at 4:02:08 PM

Resolution: No Bug
Status: closedreopened

Here is my test code

$SourceDir="i:\temp\test1"
$TargetDir="i:\temp\test2"
DirCreate($SourceDir)
DirCreate($TargetDir)
FileChangeDir($SourceDir)
For $x = 1 To 13005
	;FileWriteLine($x & ".txt",$x)
Next
FileCopy($SourceDir&"\*.*",$TargetDir&"\*.*",0)
$x+=1
FileWriteLine($x & ".txt",$x)
FileCopy($SourceDir&"\*.*",$TargetDir&"\*.*",0)
$FileCnt = DirGetSize($SourceDir,1)
ConsoleWrite(" Files in " & $SourceDir & ": " & $FileCnt[1] & @CRLF)
$FileCnt = DirGetSize($TargetDir,1)
ConsoleWrite(" Files in " & $TargetDir & ": " & $FileCnt[1] & @CRLF)

Ooops! The new files aren't copied!

>Running:(3.2.10.0):E:\Program Files\AutoIt3\autoit3.exe "I:\temp\test.au3"    
 Files in i:\temp\test1: 13006
 Files in i:\temp\test2: 13005

comment:5 by Valik, on Apr 12, 2008 at 6:50:13 PM

Well, the error is really quite obvious. You created 13,005 files, copied them all, then created 1 more file and told FileCopy() to copy all the files again but did not specify the overwrite flag. FileCopy() stops on the very first file because it's not allowed to overwrite. This is obviously not quite expected (or documented) behavior but I'm certain that it is no bug, either.

comment:6 by Nitrogen, on Apr 14, 2008 at 3:26:37 AM

But I think we expect FileCopy() will "copy all new files and skip existing files".

in reply to:  6 comment:7 by Jpm, on Apr 14, 2008 at 10:53:54 AM

Resolution: No Bug
Status: reopenedclosed

Replying to Nitrogen:

But I think we expect FileCopy() will "copy all new files and skip existing files".

Filecopy is doing what Windows does and stop when Windows stop.
You cannot expect such behavior
I will close again

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.