Boost logo

Boost Users :

Subject: Re: [Boost-users] [Filesystem] Problem with uncatchable exception whenchecking empty card reader
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-09-14 12:59:56


Marco Wedekind wrote:
> Hello,
>
> I am using the Filesystem library from boost 1.38.0 on Windows
> (Visual Studio 2005) like this:
>
> if (boost::filesystem::exists("W:") &&
> boost::filesystem::is_empty("W:")) {
> ... do something useful ...
> }
>
> "W:" is assigned to an (usually) empty card reader slot.
> Unfortunately Filesystem's exists() function fails with an
> uncatchable exception. At least I cannot catch it... The exception is
> thrown by GetFileAttributesA() in operations.hpp:
>
> inline DWORD get_file_attributes( const char * ph )
> { return ::GetFileAttributesA( ph ); }
>
> The exception pops up an error message that is titled "Windows - no
> disc" and it says:
>
> Exception Processing Message c0000013 Parameters 75b0bf9c 4 75b0bf9c
> 75b0bf9c

This is a Windows structured exception, not a C++ exception. A call to
SetErrorMode( SEM_FAILCRITICALERRORS ) may be what you need.

http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net