0
5.0kviews
Short Note on Open and Close operations.
1 Answer
0
335views
  • File operation are simply those things which user can perform on a file.

  • For example user can create file, save a file, open a file, read a file and modify a file.

  • O.S can provide system call for performing various operations on the file are : create, write, read, delete, re positioning and translating.

  • Following are same list of operations.

  1. create.

  2. write.

  3. close.

  4. open.

  5. Read.

  6. Delete.

All these operation require that the directory structure be first search for the target file.

$\rightarrow$ Open ( )

  • A file can be opened in one of the two modes, read mode or write mode.

  • In read mode, the OS does not allow anyone to alter data, file opened in read mode can be stored among several entities.

  • Write mode allows data modifications, file opened in write mode can be read but cannot be shared.

$\rightarrow$ Close ( )

  • This is the most important operation from OS point of view.

  • When a request to close a file is generated the OS.

  • OS removes all the block (in share d mode)

  • Saves the data if altered to the secondary storage media.

  • Releases all the buffn and file handlers associated with a file.

Please log in to add an answer.