flewsoftware / trash-dump Goto Github PK
View Code? Open in Web Editor NEWEasily create random file useful for software testing, network speed testing and other types of testing that requires large files
License: MIT License
Easily create random file useful for software testing, network speed testing and other types of testing that requires large files
License: MIT License
I like the idea of your program, but I do have a few suggestions and ideas. IMO it should be a little bit more Unix like. Simple invocation, scriptable, ...
Currently you get output that has to be redirected to /dev/null if you want to use it in a script. Nobody really cares about text output in such a case. But for this program there's no text required at all. (Maybe you wanted to play with multiple languages, but it's just not necessary and superfluous output only annoys people - or at least it annoys me.)
Arguments are great, but there should be short and long options. e.g. -f
for --filename
, ...
The only important argument is the size, thus it should not need an argument at all. You shoud be able to create a file by just doing this:
$ trash-dump 1048576
and you get a 1 megabyte file called tdump.tdp
(or whatever you want to choose as the default filename).
Which brings me to my next suggesttion. Allow modifiers like k
, m
, g
, which multiply the size by a factor.
10m
would be 10 * 1048576
bytes = 10 megabytes.
Also, the program should not output any text, unless invoked with -v
or --verbose
. Text output can be nice for statistics or other stuff, but there's nothing needed in the program. You can use time
(Unix/Linux command) to measure the runtime. The size of the file was specified at input time. So why do we need a text output?
The return code usually tells me everything I want to know. 0
for success. 1
for error. You can use different error codes for different errors. (disk full = 2, file exists = 1, unspecified = 3, ....).
P.S.: A Makefile
would be great to build and install the program.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.