Modify

Opened 17 years ago

Closed 17 years ago

#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 Changed 17 years ago by Jos

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 Changed 17 years ago by Jpm

I confirm Jos diagnostic
No bug under XP/Sp2

comment:3 Changed 17 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

comment:4 Changed 17 years ago by Nitrogen

  • Resolution No Bug deleted
  • Status changed from closed to reopened

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 Changed 17 years ago by Valik

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 follow-up: Changed 17 years ago by Nitrogen

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

comment:7 in reply to: ↑ 6 Changed 17 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from reopened to closed

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.