I eventually got it to go(*) and I have placed it on cpan as Win32::Fmode.

I'm not sure what I was doing wrong to be honest, but doing anything with XS seems to a bit of a trial and error process for me. I usually manage to track down my misunderstandings and once I know what they are, I can normally find the text in perlxs or perlxstut that would have allowed me to avoid the mistake had I recognised the significance of it.

If it were a portable cross-platform solution, I'd put it on cpan ...

Do the field names of the _iobuf struct vary by platform? I haven't verified my memory, but I seem to recall using a macro to obtain the file mode directly from the FILE* years ago under HP?

(*)The docs appear to be quite thorough to me, but just rather dense and understated such that you (I) have to make the mistakes and then go looking for the breif mention of the cause before recognising it as such. I'm not sure what can be done about that?

Have you ever read a graduate thesis on some deep Physics or Chemistry theory, and then later read a description of the same thing by a (good) professor. that really understands and has internalised the same material.

The former usually touches on everything in precise detail--crosses every T and dots every I--but somehow at the end of it, whilst you may be familiar with all the terminology, and able to quickly find an accurate description of everything, you end up little the wiser because there is lacking an explantion of the underlying causes/concepts.

Conversely, the latter will often skip much of the detail, by referring you to existing reference material, but it will explain, by simplification and/or analogy, the underlying concepts directly and clearly. You come away with a much better feeling of understanding, even if you need to go elsewhere for precise details.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: F_GETFL and Win32 by BrowserUk
in thread F_GETFL and Win32 by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.