1.

Solve : Tip: How to make zero length files?

Answer»

Code: [Select]type nul>zerosize.zzz
Neat I might use that.

Tan_ZaThanks. Note: zerosize.zzz is just an example. You can use any allowable filename.
ok thxWhat about
Code: [Select]echo.>>"C:\file.jpg"
That creates an empty file.Quote from: Carbon Dudeoxide on June 22, 2008, 03:46:07 AM

What about
Code: [Select]echo.>>"C:\file.jpg"
That creates an empty file.

No it doesn't. The file has 2 bytes: 1 carriage return, and 1 line feed

Code: [Select]C:\>echo.>>file.jpg

C:\>dir file.jpg
Volume in drive C is WinXP
Volume Serial Number is FC8E-1A31

Directory of C:\

22/06/2008 11:14 2 file.jpg
1 File(s) 2 bytes
0 Dir(s) 11,525,836,800 bytes free

Oh ok. Thanks.Still what I don't get is where/how it stores the file name... it sure hás to. EVEN though the actual data is null.Quote from: Schop on June 22, 2008, 06:01:09 AM
Still what I don't get is where/how it stores the file name... it sure hás to. Even though the actual data is null.

In an index type file system structure. The FAT file system uses a file allocation table, and in NTFS, the Master File Table.
So when I create zero length FILES, eventually my disk gets occupied just by my MFT, and I've read that the MFT doesn't shrink (delete entries) when you delete files? If so you could easily clog up disk space with like... twenty or so? bytes at a time.
I might just go figure out a batch LOOP to write a "few" zero lengths

(edit)
Did some research (creating lots of zero length files END calculating disk space per file) and figured they use like.. 1.2 Kb per file and when deleted there are Five bytes freed up (guess the write PROTECTION takes five bytes then) This was done on a 500Gb drive with 512 cluster size NTFS btw.
Anyway, can any one point me to some accurate data on this? Just interested


Discussion

No Comment Found