View Single Post
  #4  
Old January 19th 08, 03:10 AM posted to comp.arch.storage
mike
external usenet poster
 
Posts: 121
Default Utility to write huge files instantly???

Bill Todd wrote:
Maxim S. Shatskih wrote:
Should be able to just write the FAT without doing anything to the
actual allocation units being allocated???


Do you need NTFS support?

If you will go thru the usual filesystem, without patching the metadata
manually - then lseek() to (1GB - 1) and then write 1 byte of zero.
The OS will
zero the whole 1GB automatically.


I don't think he wants to take the time to zero (or otherwise write) the
actual file data. ISTR that an (undocumented?) API exists to
preallocate a file without writing it, though (useful for file-copy
operations where the final size is known, you want reasonable
contiguity, but don't want the useless overhead of zeroing the output
file before overwriting it with data: IIRC NT maintains 'high water
mark' information similar to VMS's that keeps one from scavenging
previous data on the disk in such cases before the real data is written).

- bill


Thanks, but when I said "utility", I meant point/click/done.
I can bungle my way thru a trivial VB6 program, but anything more than
that is a stretch.

I dug around in MSDN and found these:

IStream::SetSize

FileStream.SetLength Method

CFile::SetLength

But I'm not sure of their behavior relative to end of file and not
taking a long time. And I'd be WAY beyond my comfort level trying to
program it.

Think "UTILITY". :-)

mike

--
Return address is VALID!