SetEndOfFile with FileTest tool

Hello All,

I am not sure if it is a bug for FileTest tool or the normal file system behavior. If I open the file with FileTest tool with write access, and SetEndOfFile with some value, from the filespy it always shows the EndOfFile value is 0 instead of the value I set, but if I write data first, then set the set length of the current file, the I will see the correct value.

Does anyone know if this is the bug or I was doing something wrong?

Regards
victorR

Do you mean on the ‘write’ tab? I never use that button - it’s wired to WIN32 so it could be doing any number of weird things, including what you say.

I always use FileEofInforation on the file info tab and that does work

I meant I used SetEndOfFile on the ReadWrite tab, this is the latest versionv 2.7.0.581FileTest tool. It can’t set the right value to the file.

SetEndOfFile sets the EOF based on the current file pointer. You need to call SetFilePointer to move the file pointer out and then call SetEndOfFile. This is all just wacky Win32 stuff, it would work “as expected” if you used the native API.

Thanks Scott, you are right, the SetEndOfFile in the ReadWrite tag only set the end of file for the current file pointer. To test the SetEndOfFileInfo, it needs to go to the NtFileInfoTag.

VictorR