createfile function

Programming, for all ages and all languages.
Post Reply
icealys
Member
Member
Posts: 60
Joined: Mon Feb 17, 2014 3:54 pm

createfile function

Post by icealys »

i'm a little confused about file descriptors. What does opening a file really mean? Does the OS read from the HDD and write the file to user space? A file descriptor by definition is an abstract reference to an open file...so what does that actually mean? when you use fstream objects, are they file descriptors like stdin and stdout? Or, if i open a file using fstream would it return the file descriptor of the file that i opened? I'm confused because they say that stdin and stdout are files that get file descriptors, but ive also heard that they are streams and I can't figure out how a program would create a file like stdin or stdout.
icealys
Member
Member
Posts: 60
Joined: Mon Feb 17, 2014 3:54 pm

Re: createfile function

Post by icealys »

I think I found the answer...I was reading about named pipes and basically they are the same thing as open files in the operating system...and your program gets the handle or file descriptor as a return value. (ex. function: createfile) in windows.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: createfile function

Post by Bender »

What do you mean by a file? (In this context)
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
Post Reply