Q. Why is it advised to close a file after we are done with the read and write operations? What will happen if we do not close it? Will some error message be flashed?
Answer :-
Closing the file releases the resources. On a large system running many process you can use up all of the resources to keep track of open files. This may prevent any process from opening another file. When the process ends or crashes the OS is supposed to clean up for you.
ReplyDeleteClosing the file releases the resources. On a large system running many process you can use up all of the resources to keep track of open files. This may prevent any process from opening another file. When the process ends or crashes the OS is supposed to clean up for you.
Ok. Thank you : )
Deleteclosing the file is also a good practice while coding.
ReplyDeleteYes🤗☺️😊
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )