I recall how I processed that. 1 of 2 ways, the API that generates the 
file needs to be waited for (this isn't always possible)
The way I ended up was LLFF to get an exclusive lock on the file in a 
loop with an api call to sleep for 1/2 a second.
Tracy

Michael Madigan wrote:
> I've had problems with trying to copy a file that hasn't completed being 
> generated by the pdf generator.  For instance a 20 page pdf will take much 
> longer than a 1 page pdf to generate.
> 
> I never came up with a elegant solution, I just put in wait statements to 
> slow down the process between generation and outlook automation and copying.  
> Checking to see if the file exists doesn't help because it may not be 
> complete anyway.  Turning off write caching may help too.
> 
> 
> --- On Thu, 7/9/09, Tracy Pearson <[email protected]> wrote:
> 
>> From: Tracy Pearson <[email protected]>
>> Subject: RE: CopyFile Windows API Call
>> To: [email protected]
>> Date: Thursday, July 9, 2009, 9:29 AM
>> The only time I've seen your
>> described behavior is when multiple programs
>> access the file at the same time. Anti-virus on server
>> and/or client,
>> indexing applications such as Google desktop, and on demand
>> backup tools.
>>
>> Tracy
>>
>> -----Original Message-----
>> From: Gene Wirchenko
>> Sent: Wednesday, July 08, 2009 10:45 PM
>>
>> Hello:
>>
>>       My app does a lot of printing using
>> the Adobe PDF printer driver.  I
>> need two copies of most files.  One goes in a
>> repository (for audit
>> purposes).  One goes into an E-mail out directory
>> structure.  I generate the
>> PDF and then copy it using CopyFile().
>>
>>       Sometimes, the copy does not work, but
>> only sometimes.  I am thinking
>> that maybe it is a race condition between CopyFile and
>> Adobe Acrobat (since
>> the office has the setting to view the generated PDF).
>>
>>       Are there any issues with copying an
>> open file or Adobe opening a file
>> that is already open (presumably for read access)?
>>
>> Sincerely,
>>
>> Gene Wirchenko



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to