tags:

views:

352

answers:

3

I keep finding files which show a size of 10kb but a size on disk on 10gb. Trying to figure out how this is done, anyone have any ideas?

+5  A: 

You can make sparse files on NTFS, as well as on any real filesystem. :-)

Seek to (10 GB - 10 kB), write 10 kB of data. There, you have a so-called 10 GB file, which in reality is only 10 kB big. :-)

Chris Jester-Young
+1  A: 

I'm not sure about your case (or it might be a mistake in your question) but when you create a NTFS sparse file it will show different sizes for these fields.

When I create a 10MB sparse file and fill it with 1MB of data windows explorer will show:

Size: 10MB
Size on disk: 1MB

But in your case its the opposite. (or a mistake.)

Y Low
+2  A: 

You can create streams in NTFS files. It's like a separate file, but with the same filename. See here: Alternate Data Streams

MrZebra
ADSs can be used to hide all kinds of "lovely stuff". :-) I look at them rather like resource forks (using a MacOS analogy); in fact, in the MS implementation of Apple file sharing, ADSs are indeed used to hold resource forks.
Chris Jester-Young