What are file descriptors explained in simple terms

0 votes
What would be a more simplified description of file descriptors compared to Wikipedia's? Why are they required? Say, take shell processes as an example and how does it apply to it? Does a process table contain more than one file descriptor? If yes, why?
Apr 14, 2022 in Linux Administration by Soham
• 9,710 points
540 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
In lamens terms, when you open a file, the operating system creates an entry to represent that file and store the information about that opened file. So if there are 100 files opened in your OS then there will be 100 entries in OS. These entries are represented by integers like (...100, 101, 102....). This entry number is the file descriptor. So it is just an integer number that uniquely represents an opened file for the process. If your process opens 10 files then your Process table will have 10 entries for file descriptors.

Similarly, when you open a network socket, it is also represented by an integer and it is called a Socket Descriptor. I hope this helps you clear your doubt. Thank you!
answered Apr 20, 2022 by Rahul
• 9,680 points

edited Mar 5

Related Questions In Linux Administration

+2 votes
2 answers

What is 755 permission in Linux?

Hi, File permission 755 means that the directory ...READ MORE

answered Dec 9, 2020 in Linux Administration by MD
• 95,460 points
280,824 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,220 points
2,929 views
0 votes
1 answer

What is absolute path in Ubuntu?

An absolute path is a path to ...READ MORE

answered Feb 9, 2019 in Linux Administration by Omkar
• 69,220 points
1,560 views
0 votes
1 answer

How t find httpd.conf file in apache?

First f all, get apache's path: $ ps ...READ MORE

answered Feb 27, 2019 in Linux Administration by ajs3033
• 7,300 points
2,896 views
0 votes
1 answer

How to collect all output in one file?

You can use 2> to redirect it: foo ...READ MORE

answered Mar 1, 2019 in Linux Administration by ajs3033
• 7,300 points
1,132 views
0 votes
1 answer

Create a nested directory in Python

Try os.path.exists, and consider os.makedirs for the ...READ MORE

answered Oct 16, 2018 in Python by SDeb
• 13,300 points
1,736 views
0 votes
1 answer

How can I safely create a nested directory?

Python 3.5+: import pathlib pathlib.Path('/my/directory').mkdir(parents=True, exist_ok=True) pathlib.Path.mkdir as used above ...READ MORE

answered Nov 19, 2020 in Python by Gitika
• 65,770 points
3,527 views
0 votes
2 answers

How can I safely create a nested directory?

No need to put filename.txt For directory check path ...READ MORE

answered Nov 25, 2020 in Python by Deepak Chaurasia
1,761 views
0 votes
1 answer

How can I safely create a nested directory?

On Python ≥ 3.5, use pathlib.Path.mkdir: from pathlib import ...READ MORE

answered Nov 25, 2020 in Python by Gitika
• 65,770 points
618 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP