Page 1 of 1 1
Topic Options
#153483 - 2005-12-15 03:33 PM Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Guy's,

Some years ago I downloaded an utility that creates files with the size you specify. These are empty files but take the space you tell it to take (don't know how they do it but it worked great). I can't remember what util it was and the name. Tried searching on google but got like 16.000 links. I need to troubleshoot some transfer speed problems on our network.

Anyone know of such a tool?


Edited by Mart (2005-12-15 03:34 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153484 - 2005-12-15 04:20 PM Re: Utility to create files with random size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Found this in a round about way, havent tested:

fsutil file createnew d:\temp\1mbfile.txt 1048576

-Shawn

Top
#153485 - 2005-12-15 04:26 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Thanx, will give it spin.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153486 - 2005-12-15 04:35 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:

Found this in a round about way, havent tested:

fsutil file createnew d:\temp\1mbfile.txt 1048576

-Shawn




Sweet, works fine
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153487 - 2005-12-15 04:40 PM Re: Utility to create files with random size
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
or.....

something like this?

Code:

fatfile("test.dat",5000)


Function FatFile($file,$size)
dim $fh
dim $data[$size]
$data = join($data," ")
$fh = FREEFILEHANDLE
if exist($file) del $file endif
$ = open($fh,$file,5)
$ = writeline($fh,$data)
$ = close($fh)
endfunction



Bryce

Top
#153488 - 2005-12-15 04:42 PM Re: Utility to create files with random size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ok, you can return the favor ;0) (if you know anything about WISE / UNWISE.EXE) ... trying to google a command line option that stops a silent UNWISE un-install from rebooting the machine automatically. anyone ?

[edit]

fatfile() ... rofl great name.


Edited by Shawn (2005-12-15 04:43 PM)

Top
#153489 - 2005-12-15 06:39 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually, kf .net can do random sized files just fine.
just use the setLength() method of fileStream.

on the other hand, if one doesn't want any dependencies, the code by bryce is the best.
it has the problem that what longer the file is, that longer it takes to create it.
_________________________
!

download KiXnet

Top
#153490 - 2005-12-15 07:28 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Thanx guys.
Sorry Shawn have to skip this one. Never did anything with Wise installer. Need anything else

FatFile().udf great name for a UDF.
Like Joeel siad creating LARGE files takes some time. 500KB file took like 20 seconds :shoked:
Fsutil did a 50GB file in less then 1 second

For now I'll go with fsutil. Have to create files up to 100GB so FatFile() could take some time before it did that And fsutil warns if there is not enough space on the target drive. Don't want any dependencies so KF is not the choice for now either.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153491 - 2005-12-15 07:46 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k.
shawn, the fileStream does not work in KF.
I think it was already fixed once?
grr.

anyway, trying with my local code, with $filestream.setLength:
Code:

$system = createobject("kixforms.system")
$500MB = 500 * 1024 * 1024
@time ?
$FileStream = $system.FileStream(@scriptdir+"\someFile.dat",$system.FileMode_Create)
$FileStream.SetLength($500MB)
$FileStream.Close()
@time ?
getfileSize(@scriptdir+"\someFile.dat") ?
get $


results in:
Quote:


20:42:03
20:42:03
524288000





that is, it took less than a second to create a 500MB file on my old slow laptop system.
it's just damn shame that current build of kixforms does not work.
_________________________
!

download KiXnet

Top
#153492 - 2005-12-15 09:05 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Looks like I got screwed by FSUTIL. Created a 50GB file, deleted it and my disk says it has only 10GB free and it should be around 60GB. Did a reboot, still screwed up
And YES I did empty the recycle bin.

Hmmmmmm… will have to look into that.


Edited by Mart (2005-12-15 09:06 PM)

Top
#153493 - 2005-12-15 09:15 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
run checkdisk.
_________________________
!

download KiXnet

Top
#153494 - 2005-12-15 09:28 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, and not advertising or anything, but my 500MB file deleted just fine.
_________________________
!

download KiXnet

Top
#153495 - 2005-12-15 09:32 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Checkdisk no fixie this

Ran a defrag and it said it could not defrag some files, looked at the report and it seemed Symantec protected the bloody recycle bin even after I disabled that. Deleted them also from this Symantec recycle bin protection crap and now around 60GB is free again.
Suspected fsutil to be crappy but it came down to Symantec recycle bin protection
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153496 - 2005-12-15 10:21 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh, I had the same problem with the 2002 version of norton protected recycle bin.
after some 5 times rebooting and saying to the protected bin that I don't want it, it seems to have stopped storing the crap.
for the most of the time.
_________________________
!

download KiXnet

Top
#153497 - 2005-12-15 10:38 PM Re: Utility to create files with random size
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Running the 2004 version here and it is still there. Maybe Symantec should remove this from the product. Everyone I know that runs some version of Symantec/Norton antivirus complains about it. It really sucks and is almost impossible to disable. But that’s all off topic.
Got it running with fsutil and that’s fine for now.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#153498 - 2005-12-15 10:43 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't even run their crappy AV.
just the good old speed disk.
_________________________
!

download KiXnet

Top
#153499 - 2005-12-15 10:46 PM Re: Utility to create files with random size
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
createnew :
Creates a file of the specified name and size, whose content consists of zeroes.
 
 
FSUTIL Documentation

Quote:


Fsutil

Fsutil is a command-line utility that you can use to perform many FAT and NTFS file system related tasks, such as managing reparse points, managing sparse files, dismounting a volume, or extending a volume. Because fsutil is quite powerful, it should only be used by advanced users who have a thorough knowledge of Windows XP. In addition, you must be logged on as an administrator or a member of the Administrators group in order to use fsutil.
 




 

Top
#153500 - 2005-12-16 01:16 AM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc?
_________________________
!

download KiXnet

Top
#153501 - 2005-12-22 12:22 PM Re: Utility to create files with random size
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, there is new version out of KiXforms .net alpha

with it, my setlength() script example should work just fine.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.089 seconds in which 0.041 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org