Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curtisalexander/durse-rs
(d)irectory + rec(urse) = durse
https://github.com/curtisalexander/durse-rs
cli rust
Last synced: 1 day ago
JSON representation
(d)irectory + rec(urse) = durse
- Host: GitHub
- URL: https://github.com/curtisalexander/durse-rs
- Owner: curtisalexander
- License: apache-2.0
- Created: 2020-07-12T03:18:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T23:47:07.000Z (over 2 years ago)
- Last Synced: 2023-09-02T04:43:37.490Z (about 1 year ago)
- Topics: cli, rust
- Language: Rust
- Homepage:
- Size: 112 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# durse-rs
[![durse](https://github.com/curtisalexander/durse-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/curtisalexander/durse-rs/actions/workflows/ci.yml)
```
(d)irectory + rec(urse) = durse
```Recursively acquire file metatdata within a directory
## Use
Generated from [clap](https://crates.io/crates/clap) via `durse --help````
durse
(d)irectory + rec(urse) => recursively acquire file metadata within a directoryUSAGE:
durse.exe [OPTIONS] [PATH]ARGS:
Directory to begin recursive walk, begin in current directory if no value providedOPTIONS:
-f, --file-name Path to file to where metadata will be written
Results written to stdout if not provided
-h, --help Print help information
-o, --out-type Output file type [default: csv] [possible values: csv, ndjson]
```## Inspiration
Would like to adapt the following PowerShell one-liner.
```powershell
$SearchDir = "/some/path"
$OutCSV = "results.csv"Get-ChildItem -Path $SearchDir -Recurse -File |
Select-Object FullName, Name, Basename, Extension, DirectoryName, CreationTime, LastAccessTime, LastWriteTime, `
@{Name = 'Owner' ; Expression = { $(Get-Acl $_).Owner } }, @{Name = 'Size KB'; Expression = { $_.Length / 1KB } } |
Export-Csv -Path $OutCSV -NoTypeInformation
```> **NOTE:** The [Get-Acl]() cmdlet only works on Windows. For details one getting file permissions on Linux or macOS, see [Working with Linux Permissions in PowerShell 7](https://petri.com/working-with-linux-permissions-in-powershell-7).
## Github Actions
Below is the rough `git tag` dance to delete and/or add tags to [trigger Github Actions](https://github.com/curtisalexander/durse-rs/blob/main/.github/workflows/ci.yml#L6-L9).```sh
# delete local tag
git tag --delete v0.1.0# delete remote tag
git push origin --delete v0.1.0# add and commit local changes
git add .
git commit -m "commit msg"# push local changes to remote
git push# add local tag
git tag -a v0.1.0 -m "v0.1.0"# push local tag to remote
git push origin --tags
```