file or directory and st_mode

A

a

struct stat* buf
buf->st_mode

Is there any marco can construct the type and permission string, like
drwx------, by passing the st_mode?
Thanx
 
M

Michael Mair

a said:
struct stat* buf
buf->st_mode

Is there any marco can construct the type and permission string, like
drwx------, by passing the st_mode?

Note that there are no directories from the standard C point of view.
struct stat is not known to me, neither is st_mode, the code does not
compile, no source is provided: This cannot be answered.

Learn how to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html

Hint: If your answer solely depends on what st_mode can contain,
then you should state what it contains, otherwise mention all
additional conditions.

If there is not a very clear and obvious relationship between
the desired string and st_mode, I would rather use a function
than a macro.


Cheers
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top