LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 01-08-2004, 05:13 AM   #1
ratheesh
LQ Newbie
 
Registered: Nov 2003
Posts: 7

Rep: Reputation: 0
file creation in C


hi
i tried to create afile in C using creat() function.i succeeded in this except a file with mode 660.
the code is like this
..........
creat("/var/spool/mail/new".0660);
........
i need to create a file in /var/spool/mail/ for one of my programs.
please helpme if you can..
 
Old 01-08-2004, 06:39 AM   #2
codedv
Member
 
Registered: Nov 2003
Location: Slough, UK
Distribution: Debian
Posts: 146

Rep: Reputation: 15
Those permissions will be NAND'ed with the umask of the process. Hence if the umask is 022 and the permissions are 660 then a file with the following permissions will be created:
Code:
         
permission: 0  2  2
    NAND
umask:      6  6  0

result:     1  5  5
Have a look at man creat for more information.

Last edited by codedv; 01-08-2004 at 06:40 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zone File Creation mr_dizzle Linux - Newbie 4 10-20-2005 09:08 PM
Schedule on file creation TheLostPropet Linux - Newbie 2 04-09-2005 06:20 PM
Device file creation.... xtrem Linux - General 0 10-24-2004 01:18 AM
ls -al file creation date blackzone Linux - Newbie 2 08-23-2004 02:31 AM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 11:36 PM


All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration