Does methods of "std::fstream" set "errno" appropriately?

Hi,

Does methods of "std::fstream" set "errno" appropriately Does the mentioned anywhere in docuemnts of Visual C++

Best regards,

HouZhenYu




Answer this question

Does methods of "std::fstream" set "errno" appropriately?

  • TheOneFD

    Hi,
    I don't see a reason for it not setting that "errno" correctly (unless it has some bug). Check this page for information of what error flags are set when using fstream members:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/vclang98/html/_iostream_fstream.asp



  • Medes_

    The reason for this is that "errno" can give us some OS specific errors, for example, EACCES means access is denied. These OS specific values can be passed to other parts of the system or write to log files. Standard stream error bits do not give us such information.

  • Does methods of "std::fstream" set "errno" appropriately?