Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2007-03-16 10:30:28


Bugs item #1682161, was opened at 2007-03-16 07:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1682161&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: iostreams file_descriptor::write fails under Win32

Initial Comment:
in 1.33.1, file_descriptor::write(), append mode implemented as

#ifdef BOOST_IOSTREAMS_WINDOWS
    if (pimpl_->flags_ & impl::has_handle) {
        if (pimpl_->flags_ & impl::append) {
            ::SetFilePointer(pimpl_->handle_, 0, NULL, FILE_END);
            if (::GetLastError() != NO_ERROR)
                throw detail::bad_seek();

it is common mistake to call GetLastError() without checking function return value first. MSDN has special note for SetFilePointer():

"Note If the function returns a value other than INVALID_SET_FILE_POINTER, the call to SetFilePointer has succeeded. You do not need to call GetLastError."

So, file_descriptor::write() fails, if there is old uncleaned "last" error

Regards,

valeri.antonov_at_[hidden]

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1682161&group_id=7586

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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