file maker

  • Thread starter Thread starter sonic
  • Start date Start date
sonic wrote in said:
i'm looking for a tool to make a blank file of a specified size.

anyone have any ideas?

creating a zero byte file is simple from the DOS or NT/XP commandline
copy con somename.ext
then hit CTRL+Z to end the copy con - and you have zero byte
<somename.ext> file

But *empty* file of certain size? I figure a non-zero byte file must
be filled with something (zeros or whatever), so empty and non-zero
does not quite match. I am not a programmer, but I would guess that
the only way would be to "fake" it by manipulating the OS file system
directly - to have it read a true empty (zero byte) file as lager than
it actually is, I don't know. But creating a file of a certain size,
filled with something, anything, that is something even I can do :)

For instance, create a large text file, fill it with whatever. Then
use a file splitting program that will allow you to set size for the
output files, and then split the larger file into smaller ones - of
the size you need.

You could try: <http://www.schmeusser.siw.de/software/chainsaw.html>
or if your prefer a commandline utility (for a batch job) you could
try <http://www.vicobiscotti.it/eng/fsplit.htm> (and I am sure there
are others)

All the best,
Bjorn Simonsen
 
sonic said:
i'm looking for a tool to make a blank file of a specified size.

anyone have any ideas?

For Windows XP: you can use the Fsutil command as follows:
fsutil file createnew <file name> <file size in bytes>
(file is filled with zero's) For instance:
fsutil file createnew d:\temp\Blank.txt 1000000


For NT 4.0, Windows 2000 and XP: you can use MixedUp (zipped 43Kb)
http://www.broccolisoftware.com/products/FreewareTools/MixedUp.asp

"Creates files of random data. File size can be from 1 byte to 99
Mbytes. The random data can be totally random, or restricted to numeric
ranges."

You can let it make a file filled with zero's:
choose 'Special Content' and Range: from 0 to 0
 
As seen on PC-magzine:

We won't guarantee that forcing your swap file into a particular location
will improve performance, but you can create a file of any size using
nothing more than what's supplied with Windows. Start by converting the
desired file size into hexadecimal notation. You can use the Windows
Calculator in Scientific mode do to this. Suppose you want a file of 1
million bytes. Enter 1000000 in the calculator and click on the Hex option
to convert it (1 million in hex is F4240.) Pad the result with zeroes at the
left until the file size reaches eight digits-000F4240.


Now open a command prompt window. In Windows 95, 98, or Me, you can do this
by entering COMMAND in the Start menu's Run dialog; in Windows NT 4.0, 2000,
or XP enter CMD instead. Enter the command DEBUG BIGFILE.DAT and ignore the
File not found message. Type RCX and press Enter. Debug will display a colon
prompt. Enter the last four digits of the hexadecimal number you calculated
(4240, in our example). Type RBX and press Enter, then enter the first four
digits of the hexadecimal size (000F, in our example). Enter W for Write and
Q for Quit. You've just created a 1-million-byte file using Debug. Of course
you can create a file of any desired size using the same technique.
 
HvAs said:
As seen on PC-magzine:

We won't guarantee that forcing your swap file into a particular
location will improve performance, but you can create a file of any
size using nothing more than what's supplied with Windows. Start by
converting the desired file size into hexadecimal notation. You can
use the Windows Calculator in Scientific mode do to this. Suppose you
want a file of 1 million bytes. Enter 1000000 in the calculator and
click on the Hex option to convert it (1 million in hex is F4240.)
Pad the result with zeroes at the left until the file size reaches
eight digits-000F4240.


Now open a command prompt window. In Windows 95, 98, or Me, you can
do this by entering COMMAND in the Start menu's Run dialog; in
Windows NT 4.0, 2000, or XP enter CMD instead. Enter the command
DEBUG BIGFILE.DAT and ignore the File not found message. Type RCX and
press Enter. Debug will display a colon prompt. Enter the last four
digits of the hexadecimal number you calculated (4240, in our
example). Type RBX and press Enter, then enter the first four digits
of the hexadecimal size (000F, in our example). Enter W for Write and
Q for Quit. You've just created a 1-million-byte file using Debug. Of
course you can create a file of any desired size using the same
technique.

It creates a 1-million-byte file, but not (entirely) filled with zero's.
It just allocates 'free' space to the file, so its contents depend on
what was already written there.
When I compressed this file, this resulted in a 157.056 bytes zip file.
You do not get that when you compress a 1-million-zero-bytes file. :-)
(Note: a SFX made from a 25-giga-zero-bytes file is not a nice prank!)
 
It creates a 1-million-byte file, but not (entirely) filled with zero's.
It just allocates 'free' space to the file, so its contents depend on
what was already written there.

Good observation, makes sense - if debug only claims some space of a
certain size, then assign a filename to that space, what ever is
already in that space will become the content of the said file. I
guess buying a new HD - or wiping (write zeros to all clusters on) an
exciton one - just to be able to create a "blank" (zero filled) file
via debug, requires a little bit more effort than the OP was hoping
for. Me, I will file the debug procedure "HvA" shared with us as well
(thanks Henry), might come in handy one day - you'll never know. :)

All the best,
Bjorn Simonsen
 
Bjorn said:
Me, I will file the debug procedure "HvA" shared with us as well
(thanks Henry), might come in handy one day - you'll never know. :)

The OP seems to no longer be with us.
Someone with a non-NT based system might use a method described in
Prof. Timo Salmi's "Useful MS-DOS batch files and tricks".
ftp://garbo.uwasa.fi/pc/link/tsbat.zip
This contains the file 1BATFAQ.TXT with assorted batch tricks.
Question 148. How can I create a dummy file with a given filesize?
The answer provides a method using QBASIC embedded in a batchfile.
QBASIC is already installed, I believe, or can be installed.

=========================================================
@echo off
if "%1"=="" goto _usage
::
:: Build a QBASIC program to a file tmp$$$.bas
tmp$$$.bas echo OPEN "myfile.tmp" FOR OUTPUT AS #1
::
:: Run the QBASIC program
qbasic /run tmp$$$.bas
::
:: Show the result and clean up
dir myfile.tmp
for %%f in (tmp$$$.bas) do if exist %%f del %%f
goto _end
::
:_usage
echo Usage: %0 TheDesiredFileSize
:_end
=========================================================

This batch willl produce a file filled with the character "x".
I believe that in order to fill with zero bytes :

replace:
Cheers,
Sietse Fliege
 
sonic said:
i'm looking for a tool to make a blank file of a specified size.

anyone have any ideas?

Dummy File Creator (114KB)-
http://mynikko.com/dummy/
"A simple program which creates files of any size with ease. Very useful for
disk speed test, CD burning test, network speed test, or simply create files
to fool your friends. This program also has a built-in random function, so
users can choose to create either compressible or non-compressible files."
 
Back
Top