{"id":23074491,"url":"https://github.com/iamazeem/spancopy","last_synced_at":"2026-03-08T04:32:21.906Z","repository":{"id":90259715,"uuid":"521952848","full_name":"iamazeem/spancopy","owner":"iamazeem","description":"a CLI tool to span (copy) files with size threshold (For Linux - amd64/arm64, macOS, Windows)","archived":false,"fork":false,"pushed_at":"2026-03-02T01:46:52.000Z","size":191,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T05:04:42.841Z","etag":null,"topics":["amd64","arm64","cli","cli-app","commandline-tool","copy-files","cpp17","cross-platform","linux","macos","windows"],"latest_commit_sha":null,"homepage":"https://github.com/iamazeem/spancopy","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamazeem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-06T13:23:27.000Z","updated_at":"2026-03-02T01:46:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"467903ff-beb6-458e-b40e-878f3d889b72","html_url":"https://github.com/iamazeem/spancopy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/iamazeem/spancopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Fspancopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Fspancopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Fspancopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Fspancopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamazeem","download_url":"https://codeload.github.com/iamazeem/spancopy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Fspancopy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30245227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd64","arm64","cli","cli-app","commandline-tool","copy-files","cpp17","cross-platform","linux","macos","windows"],"created_at":"2024-12-16T08:28:39.066Z","updated_at":"2026-03-08T04:32:21.898Z","avatar_url":"https://github.com/iamazeem.png","language":"C++","readme":"# spancopy\n\n[![ci](https://github.com/iamazeem/spancopy/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iamazeem/spancopy/actions/workflows/ci.yml)\n[![Release](https://img.shields.io/github/v/release/iamazeem/spancopy?logo=github\u0026style=flat-square)](https://github.com/iamazeem/spancopy/releases)\n[![Downloads](https://img.shields.io/github/downloads/iamazeem/spancopy/total?logo=github\u0026style=flat-square)](https://github.com/iamazeem/spancopy/releases)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/iamazeem/spancopy/blob/master/LICENSE)\n\n`spancopy` is a CLI tool to span (copy) files with size threshold from `source`\nto `destination` directory. On reaching the `threshold` value, the `source`\nfiles are spanned over multiple subdirectories under the `destination`\ndirectory.\n\nFor more details, pleas refer to the [Usage](#usage) section.\n\nSupported and tested on:\n\n- Linux (AMD64 and ARM64)\n- macOS (AMD64 and ARM64)\n- Windows\n\nSee the [CI workflow](.github/workflows/ci.yml) for more details.\n\n## Download\n\nDownload the prebuilt binaries from the\n[Releases](https://github.com/iamazeem/spancopy/releases) page.\n\n## Install\n\n### Install: Linux (`apt`)\n\n```shell\n# Add repository\necho \"deb [trusted=yes] https://iamazeem.github.io/spancopy/apt/$(dpkg --print-architecture)/ ./\" | \\\n    sudo tee /etc/apt/sources.list.d/spancopy.list\n\n# Install package\nsudo apt update\nsudo apt install spancopy\n```\n\n### Install: Linux (`rpm`)\n\n```shell\n# Add repository\nsudo tee /etc/yum.repos.d/spancopy.repo \u003c\u003c EOF\n[spancopy]\nname=spancopy\nbaseurl=https://iamazeem.github.io/spancopy/rpm/\\$basearch\nenabled=1\ngpgcheck=0\nEOF\n\n# Install package\nsudo yum install spancopy\n```\n\n### Install: Nix Flake (`nix`)\n\n```shell\nnix profile add github:iamazeem/spancopy\n```\n\n### Install: Windows (`winget`)\n\n```powershell\nwinget.exe install spancopy\n```\n\n## Usage\n\nRun `spancopy --help` for usage.\n\n```text\n$ spancopy --help\nspancopy v0.0.1 - a CLI tool to span (copy) files with size threshold\nUsage: spancopy [OPTIONS]\n\nOptions:\n  -h,--help                   show help and exit\n  -v,--version                show version and exit\n  -t,--threshold UINT:SIZE [b, kb(=1024b), ...]:POSITIVE REQUIRED\n                              threshold size to span files\n  -s,--source TEXT:DIR REQUIRED\n                              source directory\n  -d,--destination TEXT:DIR REQUIRED\n                              destination directory\n\nNotes:\n- On all platforms, the `/` is used as the path separator.\n- Empty directories are ignored.\n- The sizes of all the `source` files must be less than or equal to the\n  `threshold` value. So, choose a `threshold` value accordingly.\n- The `destination` directory must have enough space for all the `source`\n  files to be copied successfully.\n- A main subdirectory under `destination` is created to avoid conflicts.\n  Following naming convention is used for this subdirectory:\n    Format:  YYYYMMDDTHHMMSSMS\n    Example: 20220820T170159946\n- The main subdirectory under `destination` is removed if it already exists.\n- For each `threshold` reached, the file(s) with their complete paths are\n  copied under their respective subdirectories i.e. 1, 2, 3, and so on.\n  For example, if for a `source` directory with some files, the `threshold`\n  is reached three times then there will three subdirectories e.g.:\n    Main subdir: 20220820T170159946\n    Threshold 1: 20220820T170159946/1/.../\u003cfile(s)\u003e\n    Threshold 2: 20220820T170159946/2/.../\u003cfile(s)\u003e\n    Threshold 3: 20220820T170159946/3/.../\u003cfile(s)\u003e\n\nExamples:\n  # spancopy from `src` to `dst` with threshold 500 bytes\n  spancopy --threshold 500b --source ./src --destination ./dst\n\n  # spancopy from `src` to `dst` with threshold 100KB\n  spancopy --threshold 100kb --source ./src --destination ./dst\n\nFor any feedback or to report any issues, please open an issue on\nGitHub: https://github.com/iamazeem/spancopy/issues\n\nWritten by: AZEEM SAJID \u003cazeem.sajid@gmail.com\u003e\n```\n\n## Example\n\nHere's a `source` directory (file sizes are in bytes for simplicity):\n\n```shell\n$ tree -hF source/\nsource/\n├── [4.0K]  dir1/\n│   ├── [  10]  file.10\n│   ├── [  20]  file.20\n│   ├── [  30]  file.30\n│   └── [  40]  file.40\n├── [4.0K]  dir2/\n│   ├── [  50]  file.50\n│   ├── [  60]  file.60\n│   ├── [  70]  file.70\n│   └── [  80]  file.80\n├── [4.0K]  dir3/\n│   └── [  90]  file.90\n├── [4.0K]  empty-dir/\n└── [ 100]  file.100\n\n4 directories, 10 files\n```\n\nIn the `source` directory, the maximum size is 100 bytes so the `threshold`\nvalue must at least be 100 e.g.:\n\n```shell\n./spancopy --threshold 100 --source ./source --destination ./destination\n```\n\nHere's the result:\n\n```shell\n$ tree -hF destination/20220820T170146582/\ndestination/20220820T170146582/\n├── [4.0K]  1/\n│   └── [ 100]  file.100\n├── [4.0K]  2/\n│   └── [4.0K]  dir1/\n│       ├── [  10]  file.10\n│       ├── [  20]  file.20\n│       ├── [  30]  file.30\n│       └── [  40]  file.40\n├── [4.0K]  3/\n│   └── [4.0K]  dir2/\n│       └── [  50]  file.50\n├── [4.0K]  4/\n│   └── [4.0K]  dir2/\n│       └── [  60]  file.60\n├── [4.0K]  5/\n│   └── [4.0K]  dir2/\n│       └── [  70]  file.70\n├── [4.0K]  6/\n│   └── [4.0K]  dir2/\n│       └── [  80]  file.80\n└── [4.0K]  7/\n    └── [4.0K]  dir3/\n        └── [  90]  file.90\n\n13 directories, 10 files\n```\n\n## Build\n\nPrerequisites:\n\n- CMake\n- C++17 compiler\n\n```shell\ngit clone git@github.com:iamazeem/spancopy.git\ncd spancopy\ncmake -S . -B build\ncmake --build build\n```\n\nThe executable will be under the `build` directory.\n\n```shell\n./build/spancopy --help\n```\n\n## Contribute\n\n- [Fork](https://github.com/iamazeem/spancopy/fork) the project.\n- Clone the forked project.\n- Check out the latest `main` branch.\n- Create a `feature` or `bugfix` branch from `main`.\n- Commit and push your changes.\n- Submit the PR.\n\n## License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamazeem%2Fspancopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamazeem%2Fspancopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamazeem%2Fspancopy/lists"}