473,414 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Please help with this command

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 ) ;
What is mode_t in this command?

Apr 13 '07 #1
5 1530
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

Apr 13 '07 #2
On 13 Apr 2007 08:40:08 -0700, 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:
It is not a command. It is a prototype declaration for a function.
>
int chmod ( const char * pathname, mode_t mode ) ;
What is mode_t in this command?
It is a non-standard name for a type. Your implementation has created
this name, probably through either the typedef specifier (more likely)
or the #define directive (less likely).

The documentation for chmod should tell you which header you need to
#include to use the function in your program. The declaration for
that name may be in that header or one of the ones it #includes.
Remove del for email
Apr 13 '07 #3
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 ) ;

What is mode_t in this command?
There is no chmod() in the Standard C language. Try
comp.unix.programmer.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com

Apr 13 '07 #4
ch**************@gmail.com wrote, On 13/04/07 16:40:
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 ) ;
It is not a command, C does not have commands. It is not a statement
either, which is as close as C comes to commands. It is a declaration,
and it declares a function with a prototype. That should be covered in
your C test book.
What is mode_t in this command?
It must be a type that is defined somewhere. It is not part of standard
C though. You could try asking in comp.unix.programmer, but they would
be quite likely to tell you to read your text book and/or man pages
and/or at least make some attempt at searching for the information with
Google (I don't know about your text book, but I know man pages and
Google answer this). After all, why should we do your homework if you won't?
--
Flash Gordon
Apr 13 '07 #5
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 ) ;
What is mode_t in this command?

This is not standard C. It is POSIX, which is another standard
altogether. A better newsgroup for you would be comp.unix.programmer.

As you are working in UNIX, you need to learn how to use the man pages
that are likely installed on your system. The people there can help you
with that.

Brian
Apr 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: me | last post by:
I have been looking online for a year, and cant find one. I used to use the int86() command in dos command-line mode, but it can't work in linux. I am using Allegro to make my program work, but I...
1
by: Yash | last post by:
Hi, Can someone please explain to me what the StreamReader.DiscardBufferedData method does? The documentation says "Use DiscardBufferedData to seek to a known location in the underlying stream...
1
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this....
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
2
by: Merdelus | last post by:
I'm a new visual basic learner, I need some help with this program below: create an application that either sums or averagethe rows or columns of a two dimensional array depending on user...
0
by: Edwinah63 | last post by:
Hi guys, i am not new to vb6, but a mere tyro in vb.net what i want to do is the following open transaction build an ADODB command object using parameters execute it build another command...
4
by: cpptutor2000 | last post by:
Could some C guru help me please? I am using the following program to open a SSH connection to a remote host and eventually run a program on that remote host. #include <stdio.h> #include...
0
by: Lemune | last post by:
Hello everyone. I'm creating windows service application to capture data from my PABX, and send the data to sql server. My question is how could my application know when that PABX is sending data...
1
by: beetle17 | last post by:
Plaintext: a  n i c e  d a y Key: -3 Ciphertext: X  k f Z b  a X v Cipher will accept commands from the user and perform the operations required by the commands. There are three different...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.