IO.Filestream: write single byte (.Net 1.1)

  • Thread starter Thread starter Armin Zingler
  • Start date Start date
A

Armin Zingler

Hi,

I use an IO.Filestream to write a single byte close to the end of a huge
file (120 GB) by setting the Position property and calling the WriteByte
method. This takes 40 minutes because all the bytes before the byte
to be written seems to be written. But I only want to write a single byte
into the file! How can this be done?


Armin
 
Armin Zingler said:
I use an IO.Filestream to write a single byte close to the end of a huge
file (120 GB) by setting the Position property and calling the WriteByte
method. This takes 40 minutes because all the bytes before the byte
to be written seems to be written. But I only want to write a single byte
into the file! How can this be done?

This sounds mad - it certainly shouldn't do that. Using the Position
property shouldn't write anything.

Is this a local file, or on a network?
 
Jon Skeet said:
This sounds mad - it certainly shouldn't do that. Using the Position
property shouldn't write anything.

Is this a local file, or on a network?


A local file. Meanwhile I got a hint in the German framework group, pointing
me to
http://groups.google.com/group/microsoft.public.win2000.file_system/msg/5d3cbefd8a0de8bf
and to the API function SetFileValidData. Seems to be the function I'm
looking for. Though, I'm still trying to find out how to obtain the required
privilege (SE_MANAGE_VOLUME_NAME) to use this function.


Armin
 
Armin Zingler said:
A local file. Meanwhile I got a hint in the German framework group,
pointing me to
http://groups.google.com/group/microsoft.public.win2000.file_system/msg/5d3cbefd8a0de8bf
and to the API function SetFileValidData. Seems to be the function
I'm looking for. Though, I'm still trying to find out how to obtain
the required privilege (SE_MANAGE_VOLUME_NAME) to use this function.


I wasn't successfull. SetFileValidData does not work. It always returns
False and I still get Win32 error 1314 ("A required privilege is not held by
the client."). But I am administrator and I do have this privilege and I do
have all access rights on the file. I don't know what to do anymore.
I'll also ask in a Win32 group about the SetFileValidData, but I'd also be
happy if you might have a hint, too.


Armin
 
Back
Top