Man-wai Chang wrote on 2014-04-24: > Out of curiosity: > > How do you check whether the file could be written into? > > On Thu, Apr 24, 2014 at 2:44 AM, Tracy Pearson <[email protected]> wrote: > I've been using a different approach. >> Local FileList[1] >> If ADIR(FileList, m.cFile) = 0 >> *-- File does not exist >> Although the FOPEN ensures you can open the file for use. I have found some >> Anti-Virus and some On-Demand backup systems will lock the file right after >> I let it go. This causes the next attempt to use it to fail. YMMV >
Man-wai, At the start of my executable, I use the API CreateFile, CloseHandle and GetLastError to determine if a file in the directory has proper rights. When the file is already open, I get an error 32, which means we have rights, just not able to open the file for edit. When the error is 5, permission is denied due to rights. This could be Network share, or NTFS rights. Tracy Pearson PowerChurch Software _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.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.

