|
Boost Users : |
From: matthias (matthias_at_[hidden])
Date: 2005-01-31 05:00:12
Vladimir Prus <ghost <at> cs.msu.su> writes:
>
> matthias wrote:
>
> > However I am getting a strange error when I start my app: When iterating
> > through a directory I suddenly get the message: Aborted.
>
> Most likely, an exception is thrown but is never caught. I suggest you wrap
> the entire function in a try/catch block and print the caught exception.
>
> - Volodya
>
I found the error in the meantime by divide and conquer. It wasn't the function
I posted which caused it, my apologies. I called boost::filesystem::file_size
without checking if I am actually working on a "file" (at least in the
boost::filesystem terminology) in some other function. This caused an exeption
to be thrown.
Frankly, I don't think this behaviour of file_size is appropriate. In UNIX, for
example, directories are files too. Therefore, file_size should return 0 when
called on a directory because it's not really an exceptional situation to call
file_size on a directory (which, as said above, often is a file).
Any comments?
Best regards,
Matthias
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