Issue unpacking directories and with octal numbers

This PR fixes two bugs I have come accross:

* Some octal fields may also end with a space. When not truncated, the from_str could fail.
* When unpacking directories where treated as files. This PR considers 'files' ending with a `/` as directories.