Giter Club home page Giter Club logo

etar's People

Contributors

jocelyn avatar

Watchers

 avatar  avatar  avatar

etar's Issues

Machine dependent tests

Some of the tests (most of the tests that create/open files) have machine dependent metadata. Check whether we can find a way to fix this

Add more verbose parse error handling

ATM USTAR_HEADER_PARSER does error reporting by setting last_parsed_header to Void. As proposed by @jocelyn in #23 this could be improved by e.g. introducing an error_message attribute that indicates where the first error occurred.

File duplication

ATM files in FILE_ARCHIVABLE are duplicated with the .twin feature. Maybe this is not enough to create a copy like it is intended. To be tested (and fixed if necessary).

Pax provides mtime key

PAX provides a reserved identifier for mtime whereas USTAR_HEADER_WRITER does not even check whether the value might be too large.

Either argument why this check can be omitted or implement it

minipax does not check if file exists with -r -f foo.tar

when trying to extract foo.tar ... I do

minipax -r -f foo.tar

but if foo.tar does not exists ... the execution violates assertions, it is missing a simple file existence checking .. and appropriate error message.

This is minor issue for the example, but could be annoying for a tool.

Checksum calculation code exists twice

Both USTAR_HEADER_PARSER and USTAR_HEADER_WRITER calculate the checksum using own features. These should be merged (e.g. in some TAR_UTILS parent class?)

FILE_UNARCHIVER ignores metadata

ATM the FILE_UNARCHIVER only creates a new file with the correct filename, but without setting any metadata that the header provides (like user, group, mode, mtime...)

Constant grouping

The constants in TAR_CONST (mostly offset and length) should be grouped in such a way that mistakes like

parse_string (block, {TAR_CONST}.tar_header_devmajor_offset, {TAR_CONST}.tar_header_devminor_length) 

become more obvious

This could be done by creating a custom class (+ once routine) for them (but then, the advantage of not having to inherit from TAR_CONST is lost)

Improve string parsing speed

The method USTAR_HEADER_WRITER is quite inefficient: It initializes Result as an empty string which is inefficient most of the cases. There is still room for improvements (parse_string is one of the core features used by the header parsers).

Cumbersome error handling

ATM error handling is rather cumbersome. For a single class it is quite easy, but as soon as this class has attributes that can produce errors as well it gets cumbersome to check whether an error occurred (have to check all attributes).

I propose some interface that allows me to register an error logger/reporter for classes that need it, such that errors can be reported / checked in a central place.

path format

The eiffel documentation tells that path strings are required to use the "escaped representation as described in UTF_CONVERTER".

Have to check what exactly this means and whether the library uses it / how to change it to do it correctly

ustar header parsing extremely slow

The ustar header parsing is so slow that the content listing demo takes ages to list the contents of an archive for which bsdtar needs milliseconds (archives/etar.tar). This is possibly caused by

  1. The content listing demo not skipping blocks that should be skipped
  2. No early termination in the ustar header parsing feature on parse failure
  3. Slow string parsing feature in TAR_HEADER_PARSER

pax header parser not checking global vs extended

ATM PAX_HEADER_PARSER does not check whether a pax header is global or extended. Therefore it will probably crash if one feeds it with a global header followed by an extended header, followed by an ustar header

Test error case

Nearly all classes that report errors are not tested for cases where errors occur

Negative Tests

ATM all tests check whether valid inputs are accepted. There should also be tests that check whether invalid inputs are rejected.

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.