[color=Blue]I do not understand your problem. You need a 55Gb file, but system tells you that there is no disk room for that and you REALLY has no disk room - only 48Gb. The error code is proper, I think.

Other question I would have asked is that if you need that much memory - then something is wrong with your algorithm. It is ALWAYS the case! When someone tries to create thousands of HWNDs or threads or other excessive thing - then I must ask why? Because, usually, the application does not need that much - there are other ways - ALWAYS![/color]

Thk u very much.I try to answer what you ask me.1.why I need to write so large file?I have another 55G file,and I need extract part of its data to save the new file(its size must be less than 55G,but I don't know what size of it precisely in advance,maybe 53G,54G,etc),Maybe you ask me why you need so large file,you can split it into many small files,I think,55Gb file,in petroleum domain,is not large file.2.In order to speed up the speed of extracting data and writing data(to create the 55Gb file),I use "file mapping object" in windows,which is involved in functions,as you know,such as CreateFileMapping and MapViewOfFile.I open the 55G file and create map object of it with the following code:hFile = CreateFile( fileName.utf16() , GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if ( hFile == INVALID_HANDLE_VALUE ) { QMessageBox::warning( 0, "aaa1", QString::fromLocal8Bit("reading data fail 1") ); return false; } hMapFile= CreateFileMapping(hFile,NULL, PAGE_READONLY,(DWORD)0,(DWORD)0,NULL); if ( hMapFile==NULL ) { QMessageBox::warning( 0, "aaa2", QString::fromLocal8Bit("reading data fail 2") ); return false; }

the H disk has more than 55G(487G) free space,the error still exist.I think that,the function CreateFileMapping does not use the disk the object file will be save to,but use the default disk(maybe C:).if I want to create a large file,how to deal with it when c disk has not enough free space?3.I want to extract part of data from a large file,how to accelerate the process of it except "file mapping".Some one tell me create a file index,I do not know how to realize it.4.Thk u a lot for help me.

[color=Blue]If you look closely at your previous post(s) - you will see that you mentioned value of 48984297472 for a disk size and it is NOT 487 Gb - it is only ~48 Gb.

So, basically, you have a 55Gb INPUT file and you need to process it - to read it, I assume - and create a 55Gb or less OUTPUT file. Answer is very simple - create a buffer of, say 8Mb (larger size will not make it faster - because of HD limits) - using VirtualAlloc() and read the input data into it by simple ReadFile() function with a handle opened in NO_BUFFERING mode - it will speed up the reading. Then simply process file by pieces of 8Mb and again write it into output buffer of another 8Mb (16Mb of memory you need in total here - nothing for Win32 basically...). When output buffer is full - dump it to disk using same NO_BUFFERING method. Very simple and fast code. You only need enough room on disk.[/color]

[color=Blue]We can go a little further -- for example: why to re-write the huge file? I can see how this might be a MUST DO situation, when you need to remove some sensitive data from the file before maybe sending it to someone else. Then you do need to re-write it.

However, if you trying to delete some information from the file just for yourself and output file really do not need to be sent. Then you might just mark data in the file as removed WITHOUT actually removing it. It does not work well with text files, but very fast with binary files, where each record in a file has same size.

So, you see -- not always a direct approach is best - you can find other options to make it more effective. Re-writing 55Gb file will take some visible time.[/color]

the size of my test data is 795,374,316 byte,and it cost 15s to finish the work.2.If I use CreateFileMapping,MapViewOfFile to extract data and write into a new file with my test data(795,374,316 byte),it cost 13s.But as you know,if the size of data file is large(for example about 55G),the 112(by getLastError) is returned of CreateFileMapping.(The error I have mentioned in my first post).I do not know how to deal with it.3.You said that 'just mark data ',and I find that the data(SEGY format,maybe you know) has no space I can mark.