| Crates.io | mkfile |
| lib.rs | mkfile |
| version | 0.4.0 |
| created_at | 2023-11-01 10:30:42.735207+00 |
| updated_at | 2025-07-29 14:28:18.765044+00 |
| description | CLI app for creating text files like mkdir. |
| homepage | |
| repository | https://github.com/AlexWanderman/mkfile |
| max_upload_size | |
| id | 1020832 |
| size | 18,716 |
Small CLI program written in Rust that creates text files. This program supports creating files with parents, with text and with Unix permissions. Can perform verbose and dry (without creating files) runs.
This program handles errors gracefully. If an error occurs, such as being unable to create a file, it will display an error message but will not delete any files or directories that have already been created. The program will continue executing and will not stop after encountering an error.
File access mode is only available for Unix. This program was not yest tested on Windows.
Install with cargo install mkfile.
Mode option is only applied for files that go after it and only for files (directories are not affected).
Text option is applied for all files.
Assume following examples are run in users home directory.
The most basic example. New file with text and permissions to be read-write for owner, read
for group and none for others. Verbose output.
mkfile -v --text "Example" --mode rw-r----- file.txt
/home/user/file.txt: Was created [mode 640].
Creating new file with parent directory.
mkfile -vp dir/file.txt
/home/user/dir/file.txt: Was created with parent.
Preview a bunch of files without actually creating them.
mkfile -d file{1..3}.txt dir/file{1..3}.txt
/home/user/Documents/Rust/mkfile/file1.txt: To be created.
/home/user/Documents/Rust/mkfile/file2.txt: To be created.
/home/user/Documents/Rust/mkfile/file3.txt: To be created.
/home/user/Documents/Rust/mkfile/dir/file1.txt (for parent): Parent does not exist.
/home/user/Documents/Rust/mkfile/dir/file2.txt (for parent): Parent does not exist.
/home/user/Documents/Rust/mkfile/dir/file3.txt (for parent): Parent does not exist.