|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
IO.Filestream: write single byte (.Net 1.1)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 <az.nospam@freenet.de> wrote:
> I use an IO.Filestream to write a single byte close to the end of a huge This sounds mad - it certainly shouldn't do that. Using the Position > 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? property shouldn't write anything. Is this a local file, or on a network? -- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet If replying to the group, please do not mail me too "Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb A local file. Meanwhile I got a hint in the German framework group, pointing> Armin Zingler <az.nospam@freenet.de> wrote: > > 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? 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
Show quote
"Armin Zingler" <az.nospam@freenet.de> schrieb I wasn't successfull. SetFileValidData does not work. It always returns> "Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb > > Armin Zingler <az.nospam@freenet.de> wrote: > > > 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? > > > 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. 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 |
|||||||||||||||||||||||