12 releases (6 major breaking)

12.0.0 Jun 25, 2023
11.0.0 Jun 14, 2023
10.0.0 Mar 23, 2023
9.0.3 Jan 18, 2023
1.0.0 Nov 15, 2022

#757 in Filesystem


Used in rust-web-server

MIT OR Apache-2…

105KB
2K SLoC

Welcome to file-ext!

Hi, file-ext is a collection of utility functions to work with files. It is tested and works on Linux, macOS and Windows.

Features

  1. File
    1. Read
    2. Read partially
    3. Does file exist
    4. Create
    5. Read file, if it doesn't exist create and write to file
    6. Write to file
    7. Delete
    8. Copy
  2. Directory
    1. Create
    2. Does directory exist
    3. Delete directory
  3. Path
    1. Absolute path to working directory
    2. Get OS dependent path separator ('/' on Unix, '\' on Windows)
    3. Get path to OS temporary folder ('/tmp' on Linux and macOS, 'C:\Users\username\AppData\Local\Temp' on Windows
  4. Symlink
    1. Does symlink exist
    2. Get path symlink points to
    3. Create symlink
  5. User
    1. Get the name of the user who is running the process
    2. Get domain user belongs to (available only on Windows)

Configuration

No additional configuration.

Demo

Take a look at mod.rs

Documentation

Take a look at mod.rs

Crate

Link to crate release.

Build

If you want to build file-ext on your own, make sure you have Rust installed.

$ cargo build

Test

If you want to test file-ext.

$ cargo test

Community

Use GitHub discussions, issues and pull requests.

There is Rust Web Server Discord where you can ask questions and share ideas.

Follow the Rust code of conduct.

Donations

Send me tips via PayPal.

  1. Rust Web Server
  2. http-to-https-letsencrypt
  3. Rust Web Framework
  4. Create Debian Package
  5. Create RPM Package
  6. Homebrew Formula

No runtime deps