Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File with 0 bytes
Message
From
05/11/2002 16:04:51
 
 
To
05/11/2002 15:36:37
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00719046
Message ID:
00719057
Views:
15
Steven,

Without seeing the code that is creating the file, it is hard to say why the file is still open...but before you copy the file you can do use fopen() to attempt to open it (of course you need to fclose() it before the copy). Put can put the fopen() attempts in a loop, and set a maximum number of tries.

Maybe a sleep delay would help, but I would still try to fopen() the file before the copy:
declare Sleep in Win32API integer nMilliseconds
=Sleep(5000)  && 5 seconds
>I am using a piece of code to manipulate MSProject and print out file using Acrobat Distiller. The Distiller files the result to the local C:\.. drive. I then in the same routine copy file the file onto a network directory for automated email purposes. The trouble I am having is that sometimes the file copied is 0 bytes. The file in the c:\.. directory is fine and this does work some of the time. It's like the copy file part of the code runs before the PDF file is through if that is possible. Maybe a timeing issue. Please help.
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform