GithubHelp home page GithubHelp logo

the-other-mariana / cylf Goto Github PK

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

A light-weight command line interface to split large files and merge them back.

License: MIT License

Go 78.82% Python 21.18%
golang split-files storage-manager

cylf's Introduction

cylf

cylf will cut your files into binary chunks that can be re-merged together using only the name of the original file.

This comes in handy when a hosting service has file size limit in the files you upload: with cylf you cut them following the size limit so that upload is allowed, and then in any desired machine you dowload those pieces and merge them using cylf again!

Usage

  1. Download the binary you need.

  2. In the same folder you got the binary, store the needed input files/folders.

Run The Executables

  • Inside bin/ folder, you will find the folders that hold the two executables (cutter + merger) of the program. Currently cylf is available for:

    • Linux Ubuntu

    • Windows 10

Linux

Open a terminal, go to the directory where the two executables and all the input files are located correctly, and type:

./cylf -a cut -n 95 -f <FILE_NAME.EXT>

or

./cylf -a merge -i <FOLDER_NAME_WITH_PARTS> -f <OUT_FILE_NAME.EXT>

depending on the action you want to do. Notice that <FOLDER_NAME_WITH_PARTS> is just the name of the folder, not the path.

*Note: if you run sudo chmod 777 cylf before any of the two commands above, you can replace ./cylf with cylf inside such commands. Also, if you want the output written to a file, add at the end of the command: > output.txt.

Windows 10

Open a terminal, go to the directory where the two executables and all the input files are located correctly, and type:

start cylf.exe -a cut -n 95 -f <FILE_NAME.EXT>

or

start cylf.exe -a merge -i <FOLDER_WITH_PARTS> -f <OUT_FILE_NAME.EXT>

depending on the action you want to do.

Run The Source Code

  • Go Version: go1.18.3 linux/amd64

Open a terminal inside ./src/folder and type:

export GO111MODULE=off

in order to avoid error messages such as package XXX is not in GOROOT or similar.

Then, type:

go run cylf.go -a cut -n 95 -f <FILE_NAME.EXT>

or

go run cylf.go -a merge -i <FOLDER_NAME_WITH_PARTS> -f <OUT_FILE_NAME.EXT>

depending on the action you want to do

img

To Cross Compile The Source Code

  • Windows 10
GOOS=windows GOARCH=amd64 go build cylf.go
  • Raspberry Pi 3 Model B
GOOS=linux GOARCH=arm go build cylf.go

cylf's People

Contributors

the-other-mariana avatar

Stargazers

 avatar  avatar

Watchers

 avatar

cylf's Issues

Does not merge

Hello,

I like what I have read about cylf since it is almost exactly what I need but have a problem.

I was testing on my Windows with your existing cylf binary and was able to split a test file with no problems.

cylf -a cut -n 1 -f BitComet_1.95_setup.exe

file: D:\Torrent\cylf\downloads/BitComet_1.95_setup.exe
[PROMPT] File will be cut into: 24 pieces with size: 1048576 bytes
[SUCCESS] Piece 1/24: D:\Torrent\cylf\downloads/95_setup/95_setup_0.cylf
[SUCCESS] Piece 2/24: D:\Torrent\cylf\downloads/95_setup/95_setup_1.cylf
[SUCCESS] Piece 3/24: D:\Torrent\cylf\downloads/95_setup/95_setup_2.cylf
[SUCCESS] Piece 4/24: D:\Torrent\cylf\downloads/95_setup/95_setup_3.cylf
[SUCCESS] Piece 5/24: D:\Torrent\cylf\downloads/95_setup/95_setup_4.cylf
[SUCCESS] Piece 6/24: D:\Torrent\cylf\downloads/95_setup/95_setup_5.cylf
[SUCCESS] Piece 7/24: D:\Torrent\cylf\downloads/95_setup/95_setup_6.cylf
[SUCCESS] Piece 8/24: D:\Torrent\cylf\downloads/95_setup/95_setup_7.cylf
[SUCCESS] Piece 9/24: D:\Torrent\cylf\downloads/95_setup/95_setup_8.cylf
[SUCCESS] Piece 10/24: D:\Torrent\cylf\downloads/95_setup/95_setup_9.cylf
[SUCCESS] Piece 11/24: D:\Torrent\cylf\downloads/95_setup/95_setup_10.cylf
[SUCCESS] Piece 12/24: D:\Torrent\cylf\downloads/95_setup/95_setup_11.cylf
[SUCCESS] Piece 13/24: D:\Torrent\cylf\downloads/95_setup/95_setup_12.cylf
[SUCCESS] Piece 14/24: D:\Torrent\cylf\downloads/95_setup/95_setup_13.cylf
[SUCCESS] Piece 15/24: D:\Torrent\cylf\downloads/95_setup/95_setup_14.cylf
[SUCCESS] Piece 16/24: D:\Torrent\cylf\downloads/95_setup/95_setup_15.cylf
[SUCCESS] Piece 17/24: D:\Torrent\cylf\downloads/95_setup/95_setup_16.cylf
[SUCCESS] Piece 18/24: D:\Torrent\cylf\downloads/95_setup/95_setup_17.cylf
[SUCCESS] Piece 19/24: D:\Torrent\cylf\downloads/95_setup/95_setup_18.cylf
[SUCCESS] Piece 20/24: D:\Torrent\cylf\downloads/95_setup/95_setup_19.cylf
[SUCCESS] Piece 21/24: D:\Torrent\cylf\downloads/95_setup/95_setup_20.cylf
[SUCCESS] Piece 22/24: D:\Torrent\cylf\downloads/95_setup/95_setup_21.cylf
[SUCCESS] Piece 23/24: D:\Torrent\cylf\downloads/95_setup/95_setup_22.cylf
[SUCCESS] Piece 24/24: D:\Torrent\cylf\downloads/95_setup/95_setup_23.cylf
[SUCCESS] File cut successfully

The problem seems to be when I tried to merge it back together.

cylf -a merge -i 95_setup -f test.exe
[PROMPT] File: ./95_setup/test-merged.exe
[SUCCESS] Files found: 24
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x38 pc=0xb9a557]

goroutine 1 [running]:
main.merge({0xc00000a108?, 0xc000020090?}, {0xc00000a0e8, 0x8})
        /home/mariana/Documents/github-mariana/cylf/src/cylf.go:89 +0x377
main.main()
        /home/mariana/Documents/github-mariana/cylf/src/cylf.go:126 +0x265

for which it did not merge the file from the "95_setup" directory.

Also, I noticed that when splitting the file with the "-n" switch that if would not allow for any size less than 1 MB as I would also like to experiment with creating chunks down in the KB range as well, if possible.

Any thoughts on these issues/questions?
Thanks

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.