[cs631apue] Archive state?

Jan Schaumann jschauma at stevens.edu
Mon Oct 7 16:48:32 EDT 2013


Tejas Nadkarni <tnadkarn at stevens.edu> wrote:
> It's weird in the even on the manpage for strmode it doesn't reference A or
> a being returned for filetype.

Correct.  A platform that does not support these file types may not
mention them in its manual page.

> Also I don't appear to have the bsd/string.h on my system so will need to
> fix that. That's why since I already have a function written to parse
> st_mode I was hoping there was a value I could check for A or a.

Well, if the platform supported this type, it'd probably provide macros
such as _S_ARCH1 an _S_ARCH2.  Your code would have to ifndef the
relevant blocks around this to be portable, though.  So in the end,
using strmode(3) is the best solution.

This is also an example of why it's useful to develop your program on
the same platform on which it is intended to run --
linux-lab.cs.stevens.edu, in this case.  The differences across unix
variants can lead to frustrations otherwise.

-Jan


More information about the cs631apue mailing list