FileAccessDenied exception

Please post support and help requests here.
Posts: 22
Joined: 21 Mar 2007, 18:56
Location: France

FileAccessDenied exception

Postby tnarol » 08 Nov 2007, 16:25


I have to delete a file if it exist so my code is something like :

File fileDest(filePath);
if (fileDest.exists())
catch (...)

While running this code under Windows with an existing file I enter the 'exist' condition but the remove function throws a "FileAccessDenied" exception.If I break the program at this point and try to delete the file manually from the explorer it works. So why could I if Poco cannot ?


Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: FileAccessDenied exception

Postby guenter » 10 Nov 2007, 18:31

Not sure why this happens. Most probably, the file is currently opened by another application. But this does not explain why the Explorer can delete the file. Try stepping into the remove() function and find out what's the Windows error code.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 4 guests