ch**************@gmail.com wrote:
I am new to C programming and learning Commands on Unix for my exam on
Interprocess communication. I would appreciate if anyone can explain
the following command:
int chmod ( const char * pathname, mode_t mode ) ;
Firstly, this is not called a command (though a Unix command of the same
name exists) but a function declaration or prototype.
What is mode_t in this command?
Typically, the '_t' is used for a typedef, i.e. it is a typedef for some
other type. What that is, I don't know. Also, I think this function is not
part of the standard C API, but rather one specific to Unix-like systems.
Now, two things:
1. You should be able to just throw this function name at google and get a
result that documents it.
2. Typical on Unix systems, you have so-called manpages. Here, on a Debian
system, chmod is documented via manpages.
3. For those Unix-specific functions there are dedicated newsgroups. If
you're not sure where something comes from and can't find out on your own
you can always ask here though or in e.g. alt.comp.lang.learn.c-c++.
Yes, I didn't answer your main question, but you should rather learn to
find out trivial things like that on your own, such skills are much more
valuable. ;)
Uli