Unix and Linux Discussions Tagged with exist |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
3 |
4,473 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
2,991 |
Shell Programming and Scripting |
|
|
|
1 |
19,153 |
Shell Programming and Scripting |
|
|
|
0 |
5,357 |
Shell Programming and Scripting |
|
|
|
1 |
7,158 |
Shell Programming and Scripting |
|
|
|
2 |
4,137 |
Shell Programming and Scripting |
|
|
|
6 |
37,361 |
Shell Programming and Scripting |
|
|
|
4 |
5,373 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
3 |
8,169 |
Shell Programming and Scripting |
|
|
|
4 |
9,231 |
Shell Programming and Scripting |
|
|
|
3 |
32,632 |
Shell Programming and Scripting |
|
|
|
7 |
8,312 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
5,444 |
Shell Programming and Scripting |
|
|
|
0 |
2,699 |
Solaris |
|
|
|
2 |
10,524 |
Shell Programming and Scripting |
|
|
|
6 |
5,150 |
Programming |
|
|
|
2 |
5,073 |
Shell Programming and Scripting |
|
|
|
13 |
10,712 |
UNIX for Dummies Questions & Answers |
|
|
|
9 |
4,383 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,991 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
6,130 |
Programming |
|
|
|
3 |
14,631 |
Shell Programming and Scripting |
|
|
|
2 |
3,538 |
UNIX for Dummies Questions & Answers |
|
|
|
27 |
11,116 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
15,512 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,698 |
UNIX for Advanced & Expert Users |
|
|
|
8 |
21,291 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
6,262 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
8,024 |
Programming |
|
|
|
3 |
3,486 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,076 |
Programming |
|
|
|
2 |
2,714 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,182 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,278 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,402 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
7,927 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,871 |
Programming |
|
|
|
3 |
2,853 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
3,259 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,188 |
UNIX for Dummies Questions & Answers |
CREAT(2) System Calls Manual CREAT(2)
NAME
creat - create a new file
SYNOPSIS
creat(name, mode)
char *name;
DESCRIPTION
Creat creates a new file or prepares to rewrite an existing file called name, given as the address of a null-terminated string. If the
file did not exist, it is given mode mode, as modified by the process's mode mask (see umask(2)). Also see chmod(2) for the construction
of the mode argument.
If the file did exist, its mode and owner remain unchanged but it is truncated to 0 length.
The file is also opened for writing, and its file descriptor is returned.
The mode given is arbitrary; it need not allow writing. This feature is used by programs which deal with temporary files of fixed names.
The creation is done with a mode that forbids writing. Then if a second instance of the program attempts a creat, an error is returned and
the program knows that the name is unusable for the moment.
SEE ALSO
write(2), close(2), chmod(2), umask (2)
DIAGNOSTICS
The value -1 is returned if: a needed directory is not searchable; the file does not exist and the directory in which it is to be created
is not writable; the file does exist and is unwritable; the file is a directory; there are already too many files open.
ASSEMBLER
(creat = 8.)
sys creat; name; mode
(file descriptor in r0)
CREAT(2)