Git Product home page Git Product logo

neiljustice / filearb Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 14.05 MB

FileArb is a C++ command line program for quickly creating an arbitrary number of text files or binary files containing an arbitrary number of characters or bytes.

License: MIT License

CMake 2.35% Shell 0.93% C++ 86.63% PowerShell 0.43% Python 8.86% C 0.79%
cpp20 linux windows clang-tidy cppcheck clang-sanitizers sonarqube jenkins python create-file

filearb's Introduction


FileArb is a cross-platform C++ command line program for quickly creating in parallel an arbitrary number of arbitrarily large text files or binary files.

Three use cases for FileArb:

  1. Performance testing the write speed of storage hardware such as USB drives, NVMe drives, and network file shares.
  2. Performance testing file-I/O-intensive programs such as FileRevisor which perform many file operations such as text replacement.
  3. Learning the true cost of cloud storage resources by way of creating, for example, 10 1-GB files on an Azure file share followed by examining the resulting Azure bill.

FileArb command line usage

FileArb v1.1.0 - Creates arbitrarily large text files or binary files.
Optional suffixes for --bytes arguments: b or B, k or K, m or M, and g or G.

Usage:
   filearb create-binary-file
      --target=<DirectoryPath>
      --bytes=<NumberOfBytes>
      [--random-bytes]
   filearb create-binary-files
      --target=<DirectoryPath>
      --directories=<NumberOfDirectories>
      --files=<NumberOfFiles>
      --bytes=<BytesPerFile>
      [--random-bytes]
      [--parallel]
      [--quiet]
   filearb create-text-file
      --target=<DirectoryPath>
      --lines=<LinesPerFile>
      --characters=<CharactersPerLine>
      [--random-letters]
   filearb create-text-files
      --target=<DirectoryPath>
      --directories=<NumberOfDirectories>
      --files=<FilesPerDirectory>
      --lines=<LinesPerFile>
      --characters=<CharactersPerLine>
      [--random-letters]
      [--parallel]
      [--quiet]

FileArb program modes

create-binary-file

filearb create-binary-file
   --target=<TargetDirectoryPath>
   --bytes=<NumberOfBytes>
   [--random-bytes]

create-binary-file creates in a specified --target directory a file named binaryfile.bin containing --bytes number of binary 0 bytes.

Console output for filearb create-binary-file --target=. --bytes=2G on Linux:

create-binary-file example on Linux

Console output for FileArb.exe create-binary-file --target=. --bytes=2G on Windows:

create-binary-file example on Windows

create-binary-file Windows Explorer

create-binary-file 2GB File Properties

Binary file in HxD

--random-bytes can be specified to create a binary file containing pseudorandom bytes sampled from std::random_device.

Here are the contents of one potential random binary file after running filearb create-binary-file --target=C:\FileArbTesting --bytes=64 --random-bytes:

Random binary file in HxD

create-binary-files

filearb create-binary-files
   --target=<TargetDirectoryPath>
   --directories=<NumberOfDirectories>
   --files=<NumberOfFiles>
   --bytes=<BytesPerFile>
   [--random-bytes]
   [--parallel]
   [--quiet]

create-binary-files creates in a specified --target directory a specified number of --directories each containing a specified number of --files each containing --bytes number of 0 bytes or [--random-bytes].

Console output for filearb create-binary-files --target=. --directories=5 --files=3 --bytes=1024 --random-bytes --parallel on Linux:

create-binary-files

create-text-file

filearb create-text-file
   --target=<TargetDirectoryPath>
   --lines=<LinesPerFile>
   --characters=<CharactersPerLine>
   [--random-letters]

create-text-file creates a text file in a specified --target directory containing --lines number of lines each containing --characters number of 0 ASCII characters per line or random capital letters if --random-letters is specified.

Console output for filearb create-text-file --target=. --lines=5 --characters=10 on Linux:

create-text-file example on Linux

create-text-files

filearb create-text-files
   --target=<DirectoryPath>
   --directories=<NumberOfDirectories>
   --files=<FilesPerDirectory>
   --lines=<LinesPerFile>
   --characters=<CharactersPerLine>
   [--random-letters]
   [--parallel]
   [--quiet]

filearb create-text-files creates at a specified --target directory a specified number of --directories each containing a specified number of --files containing 0 ASCII characters or --random-letters.

Console output for filearb create-text-files --target=target_dir --directories=5 --files=3 --lines=3 --characters=64 --random-letters --parallel on Linux:

create-text-files

FileArb code structure as it appears in Visual Studio Code on Linux

FileArb code structure as it appears in Visual Studio Code

FileArb code structure as it appears in Visual Studio 2022 on Windows

FileArb code structure as it appears in Visual Studio 2022

Linux Jenkins jobs which build and statically analyze FileArb

Linux FileArb Jenkins jobs

Windows Jenkins jobs which build and statically analyze FileArb

Windows FileArb Jenkins jobs

4 commands to build binary filearb on Linux with Clang

git clone https://github.com/NeilJustice/FileArb
cd FileArb && mkdir Release && cd Release
CXX=clang++ cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
sudo cmake --build . --target install

Resulting binary /usr/local/bin/filearb:

Resulting binary filearb

4 commands to build executable FileArb.exe on Windows with Visual Studio 2022

git clone https://github.com/NeilJustice/FileArb
cd FileArb
cmake . -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=C:\bin
cmake --build . --config Release --target install

Resulting executable C:\bin\FileArb.exe:

Resulting executable FileArb.exe

Thanks to

brandmark.io for FileArb's logo

filearb's People

Contributors

neiljustice avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.