access the same file

Hi,

if two users access the file cocurrently, they will get different
fileobject, the FsContext in fileobject maybe the same, maybe not, it is up
to the file system, say, for FAT, the FsContext are the same, for NTFS,
maybe not, because maybe they open different file stream.

So, from this point, in my file filter, how could I know that these two
users open the same file? at least the fileobject and FsContext are NOT
enough to justify it.

Your help is highly appreciated.

Bill Deng

> if two users access the file cocurrently, they will get different

fileobject, the FsContext in fileobject maybe the same, maybe not, it is up
to the file system, say, for FAT, the FsContext are the same, for NTFS,
maybe not, because maybe they open different file stream.

So, from this point, in my file filter, how could I know that these two
users open the same file? at least the fileobject and FsContext are NOT
enough to justify it.

It is enough, different stream - is different file, since it is different data.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thank you, Maxim, I understand what you mean.

But my purpose is: for every file, there is a log file relevant to it.
e.g., file1.txt ---- file1.log; file2.txt ---- file2.log

I will log the user’s operation on the file. e.g., in file.log, I have the
information as below.

User SID — Timestamp — Operation ( read / write, etc.)

I need to track the information and store it in the same log file. However,
if based on the file stream, I can’t make it.
e.g., two users modify the same file, one modify the data stream, the other
modify the alternate stream, based the FsContext, we got two different log
file, even though they visited the same file.

What should I do?

“Maxim S. Shatskih” ???:xxxxx@ntfsd…
>
> > if two users access the file cocurrently, they will get different
> > fileobject, the FsContext in fileobject maybe the same, maybe not, it is
up
> > to the file system, say, for FAT, the FsContext are the same, for NTFS,
> > maybe not, because maybe they open different file stream.
> >
> > So, from this point, in my file filter, how could I know that these two
> > users open the same file? at least the fileobject and FsContext are NOT
> > enough to justify it.
>
> It is enough, different stream - is different file, since it is different
data.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>

Why not create a multi-stream log file? :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Bill Deng”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, September 17, 2003 1:44 AM
Subject: [ntfsd] Re: access the same file

> Thank you, Maxim, I understand what you mean.
>
> But my purpose is: for every file, there is a log file relevant to it.
> e.g., file1.txt ---- file1.log; file2.txt ---- file2.log
>
> I will log the user’s operation on the file. e.g., in file.log, I have the
> information as below.
>
> User SID — Timestamp — Operation ( read / write, etc.)
>
> I need to track the information and store it in the same log file. However,
> if based on the file stream, I can’t make it.
> e.g., two users modify the same file, one modify the data stream, the other
> modify the alternate stream, based the FsContext, we got two different log
> file, even though they visited the same file.
>
> What should I do?
>
>
>
> “Maxim S. Shatskih” ???:xxxxx@ntfsd…
> >
> > > if two users access the file cocurrently, they will get different
> > > fileobject, the FsContext in fileobject maybe the same, maybe not, it is
> up
> > > to the file system, say, for FAT, the FsContext are the same, for NTFS,
> > > maybe not, because maybe they open different file stream.
> > >
> > > So, from this point, in my file filter, how could I know that these two
> > > users open the same file? at least the fileobject and FsContext are NOT
> > > enough to justify it.
> >
> > It is enough, different stream - is different file, since it is different
> data.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> >
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

well, Maxiam, thanks again, but how can I compare the two FxContext and make
sure they are the same? is there any function to do that?

“Maxim S. Shatskih” ???:xxxxx@ntfsd…
>
> Why not create a multi-stream log file? :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Bill Deng”
> Newsgroups: ntfsd
> To: “Windows File Systems Devs Interest List”
> Sent: Wednesday, September 17, 2003 1:44 AM
> Subject: [ntfsd] Re: access the same file
>
>
> > Thank you, Maxim, I understand what you mean.
> >
> > But my purpose is: for every file, there is a log file relevant to it.
> > e.g., file1.txt ---- file1.log; file2.txt ---- file2.log
> >
> > I will log the user’s operation on the file. e.g., in file.log, I have
the
> > information as below.
> >
> > User SID — Timestamp — Operation ( read / write, etc.)
> >
> > I need to track the information and store it in the same log file.
However,
> > if based on the file stream, I can’t make it.
> > e.g., two users modify the same file, one modify the data stream, the
other
> > modify the alternate stream, based the FsContext, we got two different
log
> > file, even though they visited the same file.
> >
> > What should I do?
> >
> >
> >
> > “Maxim S. Shatskih” ???:xxxxx@ntfsd…
> > >
> > > > if two users access the file cocurrently, they will get different
> > > > fileobject, the FsContext in fileobject maybe the same, maybe not,
it is
> > up
> > > > to the file system, say, for FAT, the FsContext are the same, for
NTFS,
> > > > maybe not, because maybe they open different file stream.
> > > >
> > > > So, from this point, in my file filter, how could I know that these
two
> > > > users open the same file? at least the fileobject and FsContext are
NOT
> > > > enough to justify it.
> > >
> > > It is enough, different stream - is different file, since it is
different
> > data.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.com
> > >
> > >
> > >
> >
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>