How to detect the end of file?

When I read a large file, I need read several times to got the data.
Is there a field in the irp or fileobject that can make me know I have
reach the end of the file?

Monitor the ZwReadFile return values. It will return lesser then requested
in case of EOF.

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

----- Original Message -----
From: “Kathe Zhou”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Sunday, May 16, 2004 5:30 PM
Subject: [ntfsd] How to detect the end of file?

> When I read a large file, I need read several times to got the data.
> Is there a field in the irp or fileobject that can make me know I have
> reach the end of the file?
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Is there something beyond receiving STATUS_END_OF_FILE from the I/O
operation that you are looking for? If so, I know of no such thing,
although NTFS and FAT don’t return short reads, so when you get back
less than the full amount you read it is quite likely you have reached
the end of file.

But if all you are trying to do is read until you get to EOF, I would
look for STATUS_END_OF_FILE as the completion status of the IRP.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kathe Zhou
Sent: Sunday, May 16, 2004 9:31 AM
To: ntfsd redirect
Subject: [ntfsd] How to detect the end of file?

When I read a large file, I need read several times to got the data.
Is there a field in the irp or fileobject that can make me know I have
reach the end of the file?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com