What are the Unix system calls for I/O?
- creat(name, permissions) – Used to create a file with the name and mode specified. Here, permission would be a number. 0666 means read write permissions.
- open(name, mode) – Used to open a file name in the mode (read or write) specified.0 is for opening in read mode, 1 for writing and 2 for both.
- close(fd) – Close a opened file.
- unlink(fd) – Delete a file.
- read(fd, buffer, n_to_read) – Read data from a file.
- write(fd, buffer, n_to_write) - write data from to a file.
- lseek(fd, offest, whence) - Move the read/write pointer to the specified location.
What are the UNIX system calls for I/O?
The following are the UNIX system calls for I/O:
- Open: to open a file.
Syntax:
Post a Comment