How does file descriptor work?

Sơn Lê

Member
How does file descriptor work?
Answer
A file descriptor is a non – negative integer. When we open an existing or create a new file, the kernel returns a file descriptor to a process. When we want to read or write on a file, we identify the file with file descriptor that was retuned by open or create, as an argument to either read or write.
 

Tìm kiếm

Back
Top