Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: creating empty file Pin
sarfaraznawaz29-Jul-13 23:40
sarfaraznawaz29-Jul-13 23:40 
GeneralRe: creating empty file Pin
pasztorpisti30-Jul-13 0:12
pasztorpisti30-Jul-13 0:12 
GeneralRe: creating empty file Pin
sarfaraznawaz30-Jul-13 0:20
sarfaraznawaz30-Jul-13 0:20 
GeneralRe: creating empty file Pin
pasztorpisti30-Jul-13 0:50
pasztorpisti30-Jul-13 0:50 
GeneralRe: creating empty file Pin
jeron130-Jul-13 5:06
jeron130-Jul-13 5:06 
GeneralRe: creating empty file Pin
pasztorpisti30-Jul-13 5:43
pasztorpisti30-Jul-13 5:43 
GeneralRe: creating empty file Pin
sarfaraznawaz30-Jul-13 21:24
sarfaraznawaz30-Jul-13 21:24 
AnswerRe: creating empty file Pin
Randor 30-Jul-13 21:39
professional Randor 30-Jul-13 21:39 
Hi,

Yes, you can create 'empty' files of 1GB size.

If you are on Microsoft Windows XP or above and using an NTFS file system then you can create a sparse file. This will allow you to create 'empty' files of any size that contain 'virtual zeros'. The Windows operating system will report the file as having a valid file size... and it will even apply to user disk quota.

Sparse Files[^]

Steps to create a sparse file:

1.) Call CreateFile [^]and create a new file. Keep the file handle open.
2.) Call DeviceIoControl [^] on your open file handle with the FSCTL_SET_SPARSE control code[^] to mark the file as sparse.
3.) Call the SetFilePointerEx function[^] to move from FILE_BEGIN past the end of file. Make sure to assign liDistanceToMove argument to the desired file size.
4.) Call the SetEndOfFile function[^] to set the EOF to the current position of the file pointer.
5.) Close your file hande.

Best Wishes,
-David Delaune
AnswerRe: creating empty file Pin
enhzflep30-Jul-13 2:05
enhzflep30-Jul-13 2:05 
GeneralRe: creating empty file Pin
pasztorpisti30-Jul-13 6:21
pasztorpisti30-Jul-13 6:21 
GeneralRe: creating empty file Pin
enhzflep30-Jul-13 6:46
enhzflep30-Jul-13 6:46 
GeneralRe: creating empty file Pin
pasztorpisti30-Jul-13 7:00
pasztorpisti30-Jul-13 7:00 
AnswerRe: creating empty file Pin
Erudite_Eric30-Jul-13 2:05
Erudite_Eric30-Jul-13 2:05 
GeneralRe: creating empty file Pin
Rajesh R Subramanian31-Jul-13 20:51
professionalRajesh R Subramanian31-Jul-13 20:51 
GeneralRe: creating empty file Pin
Erudite_Eric31-Jul-13 22:01
Erudite_Eric31-Jul-13 22:01 
GeneralRe: creating empty file Pin
sarfaraznawaz1-Aug-13 2:51
sarfaraznawaz1-Aug-13 2:51 
GeneralRe: creating empty file Pin
Rajesh R Subramanian1-Aug-13 6:07
professionalRajesh R Subramanian1-Aug-13 6:07 
QuestionHow to improve quality of a video.? Pin
mbatra3129-Jul-13 20:35
mbatra3129-Jul-13 20:35 
AnswerRe: How to improve quality of a video.? Pin
Erudite_Eric29-Jul-13 21:24
Erudite_Eric29-Jul-13 21:24 
GeneralRe: How to improve quality of a video.? Pin
mbatra3129-Jul-13 21:35
mbatra3129-Jul-13 21:35 
GeneralRe: How to improve quality of a video.? Pin
Erudite_Eric30-Jul-13 0:20
Erudite_Eric30-Jul-13 0:20 
GeneralRe: How to improve quality of a video.? Pin
mbatra3130-Jul-13 0:50
mbatra3130-Jul-13 0:50 
GeneralRe: How to improve quality of a video.? Pin
Erudite_Eric30-Jul-13 2:08
Erudite_Eric30-Jul-13 2:08 
GeneralRe: How to improve quality of a video.? Pin
mbatra3130-Jul-13 2:15
mbatra3130-Jul-13 2:15 
GeneralRe: How to improve quality of a video.? Pin
mbatra3130-Jul-13 2:19
mbatra3130-Jul-13 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.