open (system call)

During the open, the filesystem may allocate memory for buffers, or it may wait until the first operation.

This may include connecting to a remote host and notifying an operator that a removable medium is required.

An error will usually be returned if the higher level components of the path (directories) cannot be located or accessed.

This will cause run-time library and filesystem buffers to be updated to the physical media and permit other processes to access the data if exclusive use had been required.

Some open routines include specification of the program code to be executed in the event of an error.

[2] The open call is standardized by the POSIX specification for C language: The value returned is a file descriptor which is a reference to a process specific structure which contains, among other things, a position pointer that indicates which place in the file will be acted upon by the next operation.

Open may return −1 indicating a failure with errno detailing the error.

creat() is implemented as: fopen uses string flags such as r, w, a and + and returns a file pointer used with fgets, fputs and fclose.

These include read, write or execute the file by the owner, group or all users.