Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 19th, 2003, 11:50 AM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
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
Reply With Quote
  #2 (permalink)  
Old June 19th, 2003, 12:12 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
Reply With Quote
  #3 (permalink)  
Old June 19th, 2003, 05:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #4 (permalink)  
Old June 19th, 2003, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sparks, NV, USA.
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
Reply With Quote
  #5 (permalink)  
Old June 19th, 2003, 07:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
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
Reply With Quote
  #6 (permalink)  
Old June 20th, 2003, 10:13 AM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:49 PM.


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