<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Anton Shepelev <<a href="mailto:anton.txt@gmail.com">anton.txt@gmail.com</a>> schrieb am Mo., 11. März 2019, 15:12:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sven Barth to Anton Shepelev:<br>
<br>
>>Since we already have cross-platform functions FileRead<br>
>>and FileWrite, would not it be useful to have them set the<br>
>>InOutRes variable, or to publish a facility for converting<br>
>>the value of GetLastOSError into an InOutRes value?<br>
><br>
>The usage of InOutRes is only defined for the Pascal style<br>
>file I/O (Read/Write).<br>
<br>
Thanks for the correction. My second propostion, however,<br>
still holds. Writers of drivers for this Pascal-style I/O<br>
interface should have the ability to convert OS-specific<br>
error codes into InOurRes values, which are not even<br>
documented at:<br>
<br>
<a href="https://www.freepascal.org/docs-html/rtl/system/inoutres.html" rel="noreferrer noreferrer" target="_blank">https://www.freepascal.org/docs-html/rtl/system/inoutres.html</a></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You're not supposed to use InOutRes directly to read it (that should probably be added to its documentation) , but instead IOResult needs to be used. And *there* the values are documented: <a href="https://www.freepascal.org/docs-html/rtl/system/ioresult.html">https://www.freepascal.org/docs-html/rtl/system/ioresult.html</a></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Notice also that FreePascal's TextRec handling is<br>
incompatible with that of Delphi. The TextRec operations<br>
OpenFunc, InOutFunc, FlushFunc, and CloseFunc return a<br>
longint, which Delphi interprets as the result code but<br>
FreePascal ignores. Therefore, I must set InOutRes in<br>
FreePascal and return the error in Delphi.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Now *that* is something that can and probably also should be talked about. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>