Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2003, 11:50 AM
Authorized User
 
Join Date: Jun 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default Monitoring files

Im creating a program to watch folder downloaded from a FTP site.
When the transmission is complete I'll move the files in to another Directory.
Currently I used a FileSystem object to monitor the files that been put in the directory but evertime I start downloading the files it shows the filename and the transmission is not complete, then If I move it the file is corrupt.
How can I know if the transmission is complete.

If you have any ideas on a better way to know the transmisson is complete I would like to here from you.



Thanks
Elmer
 
Old June 19th, 2003, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...
a couple of quick ideas...

build an output file.. monitor that file.. and when a download is complete write a line there so you now that the file is ready..
build another file while an extention like .XXX so you know that the file is ready when this file disapear (or make this file apear when you finish the download)...

HTH..


Gonzalo Bianchi
 
Old June 19th, 2003, 05:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gonzalo, that is a good technique if you know when the ftp is done, but it
does now work if someone else is sending the file.
I was struggling to find out a way to know that a file is still is use,
and at the end I used the following: I check the size of the file, and
if does not grow in the last five minutes (or if another file has been
downloaded) I consider the transmission done. Not great, but it works
in my case.

Marco
 
Old June 19th, 2003, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

I would expect that while the FTP is going on, the file is locked for writing. That being the case, when you discover the filename, before you start copying it, couldn't you try to open for append. If the open for append raises an error then the FTP is not complete. If the open for append doesn't raise an error, then close it and copy it.

John R Lick
JohnRLick@hotmail.com
 
Old June 19th, 2003, 07:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is what I would have expect as well... but it was not true in all cases!

Marco

Quote:
quote:Originally posted by jlick
 I would expect that while the FTP is going on, the file is locked for writing. That being the case, when you discover the filename, before you start copying it, couldn't you try to open for append. If the open for append raises an error then the FTP is not complete. If the open for append doesn't raise an error, then close it and copy it.

John R Lick
JohnRLick@hotmail.com
 
Old June 20th, 2003, 10:13 AM
Authorized User
 
Join Date: Jun 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default

thanks for replying to my post message I'll try all your Ideas. and anyone will give me more technique I really appreciate.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring DrPurdum BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 8 November 25th, 2008 06:37 AM
Monitoring URL Dhananjay prajapati Visual Basic 2005 Basics 1 March 1st, 2007 06:34 PM
I'm still monitoring this forum... .MAttButler BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 0 September 26th, 2006 10:50 PM
Monitoring gangeles VB.NET 0 May 22nd, 2006 09:38 AM
COM+ Monitoring using COMSVCSLib bappelt VB Components 2 August 1st, 2005 10:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.