Re: URGETN !. How to check a file status/attributes ???
- From: "Dave" <Nobody@xxxxxxxxxxx>
- Date: Fri, 2 Sep 2005 11:38:47 +0100
That probably wont work as (in some cases) when copying a file the system
allocates the full size of the file then fills the space so the system will
return the full size even if the whole file is not copied.
You could try to rename the file, if it fails the file is still busy.
Definately get rid of the FSO and also as there are files coming in all the
time, store a list of files and work through that because if you iterate a
(FSO) collection, the folder content may change before you get to the end of
the collection which could cause unpredictable errors.
Regards
Dave.
"Andibevan" <Andibevan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:uCzreKvrFHA.2592@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Ahmed,
>
> Is there any way that you could obtain the size of the files on the FTP
> folder?
>
> If you could you could then compare the sizes of file in d:\process and on
> the FTP and only copy the files if the size matches.
>
> http://www.vbip.com/protocols/ftp/vb-ftp-client-library/default.asp
> provides
> some code for implementing FTP within VB.
>
> Regards
>
> Andy
>
> "Ahmed Jewahar" <ahmed.jewahar@xxxxxxx> wrote in message
> news:ONGUZlsrFHA.2996@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> Dear All
>>
>> I'm writing a program in VB which will read all files from a folder that
>> I specify. For instance the folder name is "D:\process"
>>
>> Folder "D:\process" is contniiously getting the files every 1 minniutes
>> from another server via FTP. What I'm basically looking for is I need
>> to identify the file(s) which is completeley copied and files whcih are
>> in copying in progress. I need to move only files which are completed
>> the copying.
>>
>> Below is the code that I have written. But, I got stuck with above !.
>>
>> Dim fso, mFolder, mFile, mFiles, s
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> Set mFolder = fso.GetFolder("D:\Process")
>> Set mFiles = mFolder.Files
>>
>> ReDim FileNameArray(mFolder.Files.Count + 1, 2)
>> Dim mcounter As Integer
>> mcounter = 0
>> For Each mFile In mFiles
>>
>> ****************************************
>> I need some code here to find out whehter file being copied completely
>> or not
>> ****************************************
>> mcounter = mcounter + 1
>> FileNameArray(mcounter, 1) = mFile.Path
>> FileNameArray(mcounter, 2) = mFile.Name
>>
>>
>> Next
>>
>> fso.CopyFile FileNameArray(n, 1), "D:\work\"
>>
>>
>> In order to find this, what property I need to check to find out status
>> of a file such as "copy completion" and "Copying in progress".
>>
>> Many thanks and regards,
>>
>>
>>
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>
>
.
- References:
- URGETN !. How to check a file status/attributes ???
- From: Ahmed Jewahar
- Re: URGETN !. How to check a file status/attributes ???
- From: Andibevan
- URGETN !. How to check a file status/attributes ???
- Prev by Date: Re: Getting files form directory structure
- Next by Date: Re: Getting files form directory structure
- Previous by thread: Re: URGETN !. How to check a file status/attributes ???
- Next by thread: Re: URGETN !. How to check a file status/attributes ???
- Index(es):
Relevant Pages
|