Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Garbage Generator
Index -> Programming, Java -> Java Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
randint




PostPosted: Fri Feb 17, 2012 4:45 pm   Post subject: Garbage Generator

This program generates "garbage" files containing 0s until IOException is thrown because the space is filled


WriteZero.java
 Description:
Writing zeros to files until disk is full

Download
 Filename:  WriteZero.java
 Filesize:  848 Bytes
 Downloaded:  209 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
mirhagk




PostPosted: Sat Feb 18, 2012 1:07 am   Post subject: RE:Garbage Generator

And the point is............. And this takes more than 5 seconds normally.......
randint




PostPosted: Sat Feb 18, 2012 3:07 pm   Post subject: RE:Garbage Generator

Oh, the point of that, is to create garbage and other evil things
Tony




PostPosted: Sat Feb 18, 2012 3:47 pm   Post subject: RE:Garbage Generator

well that is not very useful... it can also be accomplished in a single line, by copying content out of /dev/zero -- http://en.wikipedia.org/wiki//dev/zero
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
DemonWasp




PostPosted: Sat Feb 18, 2012 6:25 pm   Post subject: RE:Garbage Generator

Funnily enough, he actually writes ASCII '0', which is 0x30, not 0x00.

Plus, it'll only ever saturate the logical volume it's run on, and even then writes a maximum of about 5.5TB. You could do this faster, better, and more accurately with: dd if=/dev/zero of=/dev/sda bs=4k

(Seriously though, don't run that. If you destroy your own system, it is completely and totally not my fault.)
randint




PostPosted: Sat Feb 18, 2012 10:16 pm   Post subject: RE:Garbage Generator

chkdsk detected errors anyhow, but I do not know why though, could anyone tell me why this program is destructive?
Display posts from previous:   
   Index -> Programming, Java -> Java Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: