我试用过 TFileStream,还有 API CreateFile、WriteFile 来建立这个大文件,都要几K几K地写数据,速度很慢,如果有 TC 里面的 fwrite 就好了fwrite
Writes to a stream Declaration:
size_t fwrite(const void *ptr, size_t size, size_t n, FILE*stream); Res:
fwrite appends a specified number of equal-sized data items to an output
file. Argument What It Is/Does
--------------------------------------------------------------
ptr Pointer to any object; the data written begins at ptr
size Length of each item of data
n Number of data items to be appended
stream Specifies output fileThe total number of bytes written is
(n * size)现诚心请教,如果快速建立一个超过3G的大文件,文件内容全部为 $0。
Writes to a stream Declaration:
size_t fwrite(const void *ptr, size_t size, size_t n, FILE*stream); Res:
fwrite appends a specified number of equal-sized data items to an output
file. Argument What It Is/Does
--------------------------------------------------------------
ptr Pointer to any object; the data written begins at ptr
size Length of each item of data
n Number of data items to be appended
stream Specifies output fileThe total number of bytes written is
(n * size)现诚心请教,如果快速建立一个超过3G的大文件,文件内容全部为 $0。
http://search.csdn.net/Expert/topic/1256/1256981.xml?temp=.7714502我见过一个程序建立1G的文件,不到1秒钟就搞定了。不知道是怎么建立的。
建立一个 1G 的文件,在FAT32分区中,花费 32917 毫秒,在NTFS分区中花费 40 毫秒!