Jump to content

FileCopy() Lagre Files Problem


Krikov
 Share

Recommended Posts

Hello i have Writen a Code That Copy Files From A Removale Media to A Map Network Drive

And in my code i Check For The Number for Chr of the File Name if The File Name is longer then 20 Chr

it Will Ignore It and Continue to the next File.

After I Test it I have Found that Files With More then 10MB The Script Try to Copy the File But maybe Cuz

its a Large File its Failed and all The Small Files (Less Then 10MB) Copyed without no problem

Did Some one Know how to Fix it.

Best Regards

Krikov

:P

[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Link to comment
Share on other sites

Hello i have Writen a Code That Copy Files From A Removale Media to A Map Network Drive

And in my code i Check For The Number for Chr of the File Name if The File Name is longer then 20 Chr

it Will Ignore It and Continue to the next File.

After I Test it I have Found that Files With More then 10MB The Script Try to Copy the File But maybe Cuz

its a Large File its Failed and all The Small Files (Less Then 10MB) Copyed without no problem

Did Some one Know how to Fix it.

Best Regards

Krikov

:P

Could you please post your script so that people can see what you have done. The problem could be with your script and it would be impossible to diagnose a problem without seeing it.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Well Here Is The Code.

#include <file.au3>
#include<Array.au3>

$DirList = _FileListToArray("D:\tmp","*",2)
    If IsArray($DirList) Then
    ;_ArrayDisplay($DirList,"Dir Name")
        For $X = 1 to $DirList[0]
            $File = $DirList[$X]
            $Filelist = _FileListToArray("D:\Tmp\"&$File,"*",1)
        ;_ArrayDisplay($Filelist,"File Name")
            For $Z = 1 to $Filelist[0]
                $FileToCopy = $Filelist[$Z]
                If StringLen($FileToCopy) < 20 Then
                ;MsgBox(0,"",$FileToCopy)
                ;MsgBox(0,"","SRC = D:\tmp\"&$File&"\"&$FileToCopy)
                ;MsgBox(0,"","DST = D:\NetDrive\"&$File&"\"&$FileToCopy)
                    FileCopy("D:\tmp\"&$File&"\"&$FileToCopy,"D:\NetDrive\"&$File&"\"&$FileToCopy,9)
                EndIf
            Next    
        Next
    EndIf

[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Link to comment
Share on other sites

...After I Test it I have Found that Files With More then 10MB The Script Try to Copy the File...

I see nothing in your code to limit it from coping large files. It only skips files with filenames longer than 20 characters. Perhaps there is a known correlation between these two things in your files.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

i am not intend to skip copy file Larger the 10Mb

When i Lunch The Script I can see the Media Copying The Files

But When I Check What Files has Been Copyed i have Found that only Small Files From 0K to 10MB

Have Been Copyed and Some File With 25MB and More not Copyed

Krikov

[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Link to comment
Share on other sites

i am not intend to skip copy file Larger the 10Mb

When i Lunch The Script I can see the Media Copying The Files

But When I Check What Files has Been Copyed i have Found that only Small Files From 0K to 10MB

Have Been Copyed and Some File With 25MB and More not Copyed

Krikov

For the process of elimination

What happens if you select some big files manually with Explorer & copy them to the network location.?

Do they copy ok ?

HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

Well i have fix it by my self and the solution is

When We Copy Files With Autoit With The Function FileCopy() The System Start To Copy The File

But its not Wait Until The File Will Completly Copyed And Start Anuther Copy of File

And The Fix Is to Check The File Size on The Removal Media And Wait Until The Size is Equal To The Size

on the Destenaion

#include <file.au3>
#include<Array.au3>

$DirList = _FileListToArray("D:\tmp","*",2)
    If IsArray($DirList) Then
    ;_ArrayDisplay($DirList,"Dir Name")
        For $X = 1 to $DirList[0]
            $File = $DirList[$X]
            $Filelist = _FileListToArray("D:\Tmp\"&$File,"*",1)
        ;_ArrayDisplay($Filelist,"File Name")
            For $Z = 1 to $Filelist[0]
                $FileToCopy = $Filelist[$Z]
                $StrSplit = StringSplit($FileToCopy,".",1)
            ;_ArrayDisplay($StrSplit,"nnn")
            ;MsgBox(0,"",$StrSplit)
                If StringLen($StrSplit[1]) < 20 Then
                    $FileSZ = FileGetSize("D:\"&$File&"\"&$FileToCopy); Check For The File Size on The Removal Media
                    If FileExists("D:\"&$File&$FileToCopy) Then
                        While
                            if $FileSZ > FileGetSize("d:\"&$File&"\"$FileToCopy); Compare The Size of the Copy File With The Source File
                                ContinueLoop  
                            EndFunc
                        WEnd
                    EndIf       
                ;MsgBox(0,"",$FileToCopy&" "&"Number Of CHR is "&StringLen($StrSplit[1]))
                ;MsgBox(0,"","SRC = D:\tmp\"&$File&"\"&$FileToCopy)
                ;MsgBox(0,"","DST = D:\NetDrive\"&$File&"\"&$FileToCopy)
                ;FileCopy("D:\tmp\"&$File&"\"&$FileToCopy,"D:\NetDrive\"&$File&"\"&$FileToCopy,9)
                EndIf
            Next    
        Next
    EndIf

Krikov :P

[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...