Boost logo

Boost :

Subject: Re: [boost] [filesystem] truncate() function?
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2009-10-14 22:59:36


On Wed, Oct 14, 2009 at 10:45 AM, Beman Dawes <bdawes_at_[hidden]> wrote:
> There was a request on the users list for a file truncate() function similar
> to the POSIX function of the same name. Since Windows provides a function
> with virtually identical semantics, this seems like a reasonable request.
>
> The POSIX spec includes:
>
> "If the request would cause the file size to exceed the soft file size limit
> for the process, the request shall fail and the implementation shall
> generate the SIGXFSZ signal for the process."
>
> I have no knowledge of or experience with POSIX signals, so need advice.
>
> Does the POSIX implementation need to do anything to cope with the
> possibility of a SIGXFSZ signal? If so what?
>
> Thanks,
>
> --Beman

It may be beyond the scope of Boost.Filesystem, but I'd really prefer
C++ exceptions to be thrown instead of SIG faults. Particularly if
I'm trying to write x-platform code, which might very well be the
reason I'm using Boost.Filesystem instead of direct OS calls in the
first place.

But I can see this being a more general (and useful) feature - a SIG
handler that converts to C++ exceptions. (I've written similar for
Windows Structured Exceptions in the past.)

Tony


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk