[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Files



yeah... it is possible.. i found a lot of replies like this.. to tell
u the actual reason, it is like two processes accessing the same
memory..

suppose think of the followin gblock of code in the same program

int i=5;
fork();
i++;
printf("%d",i);

here in the above code after fork a seperate copy of the saem memory
is inherited from the parent process. therefore every process will
have its own resource copy. to be more clear...
every process will have its own process table entry and file tabel
entry. so same file can be accessed by two different processes at the
same time. even i am also a begineer.. i am not sure with my answer.
if anybody finds and misconception here kindly correct me...

Ramesh.



----- Original Message -----
From: Harpreet Singh (RBIN/DCA-NMP)
To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
Sent: Monday, December 04, 2000 7:02 PM
Subject: [LIP] Files


Hi,

When a file is opened for reading by one program, can the same file be
opened for reading by another program at the same time.
And when this file is opened for reading by one program, can the same
file
be opened for writing or updation by another program at the same time.