Avatar of pzozulka
pzozulka

asked on 

C Programming: Working with OPEN(2) and File Descriptors

After reading about OPEN(2), I am still confused about the returned value.

http://man7.org/linux/man-pages/man2/open.2.html

It says that the returned value is a File Descriptor, but I tried googling it, and cannot find much about file descriptors, and how to use them.

I have a project that requires me to work with file descriptors, and I would like to learn more about their built-in functions.

Can you please provide a examples of working with "fd" after using the OPEN command?
C

Avatar of undefined
Last Comment
mccarl
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of pzozulka
pzozulka

ASKER

Thanks to both of you. mccarl, your explanation is extremely clear, so no further advice is needed. I'm sure I'll be posting more questions about this project soon.
Avatar of mccarl
mccarl
Flag of Australia image

Not a problem, glad to help!
C
C

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.

23K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo