[SOLVED]FileOpen vs FileRead

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Muneer
Member
Member
Posts: 104
Joined: Tue Nov 02, 2010 2:05 am
Location: India

[SOLVED]FileOpen vs FileRead

Post 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?
Last edited by Muneer on Tue Feb 01, 2011 5:51 am, edited 1 time in total.
Even the smallest person could change the course of the future - Lord Of The Rings.

In the end all that matters is what you have done - Alexander.

Even after a decade oh god those still gives me the shivers.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: FileOpen vs FileRead

Post 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?
User avatar
Muneer
Member
Member
Posts: 104
Joined: Tue Nov 02, 2010 2:05 am
Location: India

Re: FileOpen vs FileRead

Post by Muneer »

Hi James,


the fileOpen and fileRead context I was referring to was that of a Virtual File System.
Even the smallest person could change the course of the future - Lord Of The Rings.

In the end all that matters is what you have done - Alexander.

Even after a decade oh god those still gives me the shivers.
User avatar
Muneer
Member
Member
Posts: 104
Joined: Tue Nov 02, 2010 2:05 am
Location: India

Re: FileOpen vs FileRead

Post 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.
Even the smallest person could change the course of the future - Lord Of The Rings.

In the end all that matters is what you have done - Alexander.

Even after a decade oh god those still gives me the shivers.
User avatar
prinzrainer
Posts: 13
Joined: Sun Nov 22, 2009 11:36 pm

Re: FileOpen vs FileRead

Post 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.
User avatar
Muneer
Member
Member
Posts: 104
Joined: Tue Nov 02, 2010 2:05 am
Location: India

Re: FileOpen vs FileRead

Post by Muneer »

Yeah I got it. That does seem logical.
Thanks to everyone.
Even the smallest person could change the course of the future - Lord Of The Rings.

In the end all that matters is what you have done - Alexander.

Even after a decade oh god those still gives me the shivers.
Post Reply