Page 1 of 1

[SOLVED]FileOpen vs FileRead

Posted: Tue Feb 01, 2011 2:20 am
by Muneer
Hi ,

Can anyone tell the difference between a fileOpen as well as a fileRead. I can figure out that a fileRead is getting the contents of a file and storing it in memory. But what is fileOpen then?

Re: FileOpen vs FileRead

Posted: Tue Feb 01, 2011 2:21 am
by JamesM
HardCoder wrote:Hi ,

Can anyone tell the difference between a fileOpen as well as a fileRead. I can figure out that a fileRead is getting the contents of a file and storing it in memory. But what is fileOpen then?
In what OS, what context?

Re: FileOpen vs FileRead

Posted: Tue Feb 01, 2011 2:25 am
by Muneer
Hi James,


the fileOpen and fileRead context I was referring to was that of a Virtual File System.

Re: FileOpen vs FileRead

Posted: Tue Feb 01, 2011 3:23 am
by Muneer
Hi.
One opens the file, one reads from the open file.
That was what I was confused about. I can figure out the read but still cant understand what "openFile" does. Can you describe the implementation of the "openFile" , i.e when an application calls the openFile with a path name to the file, what exactly is the function expected to do and return to the application.

Re: FileOpen vs FileRead

Posted: Tue Feb 01, 2011 4:30 am
by prinzrainer
Basically it manages files that being used. For example, one program might request an openfile for writing. With this, the fs manager can block another program from opening it.

Re: FileOpen vs FileRead

Posted: Tue Feb 01, 2011 5:50 am
by Muneer
Yeah I got it. That does seem logical.
Thanks to everyone.