Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

Rep: Reputation: 0
file creation in C

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
i need to create a file in /var/spool/mail/ for one of my programs.
please helpme if you can..
Old 01-08-2004, 05:39 AM   #2
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:
permission: 0  2  2
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 05:40 AM.


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 08:08 PM
Schedule on file creation TheLostPropet Linux - Newbie 2 04-09-2005 05:20 PM
Device file creation.... xtrem Linux - General 0 10-24-2004 12:18 AM
ls -al file creation date blackzone Linux - Newbie 2 08-23-2004 01:31 AM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:58 AM.

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