Coder Social home page Coder Social logo

par2drive's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

jnite

par2drive's Issues

Barfs when encountering 0 byte files

# create test directory:
username@computer:~> mkdir ~/par2test/

# create empty file:
username@computer:~> touch ~/par2test/a
# create non-empty file:
username@computer:~> </dev/urandom head -c 10m >~/par2test/b

# run par2test in test directory
username@computer:~> cd ~/par2test/
username@computer:~/par2test> par2drive sync .
working on ./a
was modified, generating again the parity files
Skipping 0 byte file: /home/username/par2test/a
You must specify a list of files when creating.
Warning! error detected, terminating batch processing.

username@computer:~/par2test> ls .
a  b

As the above shows, any 0 byte files will prevent par2drive from working on any other file.

I think I fixed it for myself by changing line 147 from

if [ "$date_last_modified_parity" -lt "$date_last_modified_file" ] ; then

to

if [[ -s "$file" && "$date_last_modified_parity" -lt "$date_last_modified_file" ]] ; then

but that uses the [[ ... ]] bashism, which I understand is not acceptable for what your script targets.

I'm sure a portable solution is simple, but I'm not aware of the best method. I didn't want to add an entirely new if statement just for that, so I gave up on trying.

[Feature Request] Option To Save Parity Files To Separate Folder

For folders with many files, all the generated parity files tend to clutter up the source folder. It would be great if we could pass an optional folder path for saving all the parity files to. It would have an identical folder structure that mirrors the source path, but would only contain parity files.

Or do you have any other suggestions for preventing source folders from being crowded with parity files?

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.