Menu

How to use bunzip2? new

Help
2011-05-04
2012-07-26
  • Nouf Khalid

    Nouf Khalid - 2011-05-04

    Hello,

    I tried to use the bunzip2 command from the "Command Prompt" and I had the
    following message:

    bunzip2: I/O or other error, bailing out. Possible reason follows.

    bunzip2: Permission denied

    Input file = enwiki.bz2, output file = enwiki

     
  • Allan

    Allan - 2011-05-04

    It is possible that the "read-only" attribute is set; type "attrib enwiki.bz2"
    to display the file attributes. If you see "R" then it is a read-only file.
    You can remove the attribute by typing "attrib -r enwiki.bz2" if required.

     
  • Keith Marshall

    Keith Marshall - 2011-05-05

    It really shouldn't matter whether the read-only attribute is set for the
    input file (enwiki.bz2), or not. That shouldn't raise a "permission denied"
    exception. However, if the output file (enwiki) already exists, and it has
    the read-only attribute, then that would raise this exception. Another
    possibility is that the OP doesn't have write permission for the directory in
    which he/she is trying to save the output file(s).

     
  • Allan

    Allan - 2011-05-05

    In the documentation it mentions the "-k" switch which might help. There is no
    need to change the file attribute of the input file in this case. (On Windows
    a read-only file normally cannot be deleted without asking for confirmation.)

    ... However, if the output file (enwiki) already exists, and it has the
    read-only attribute, then that would raise this exception. Another possibility
    is that the OP doesn't have write permission for the directory in which he/she
    is trying to save the output file(s).

    If the output file already exists then the OP might have received a different
    error message such as

    "bunzip2: Output file enwiki already exists.".

     
  • Keith Marshall

    Keith Marshall - 2011-05-06

    Sorry, I was forgetting that gzip, bzip2, lzma, xz and friends default to
    compressing/decompressing in place, (i.e. overwriting the original file with
    the compressed/decompressed content). In that case, for transformation in
    either direction, of course the original file needs to be writeable, so it can
    be removed after successful conversion.

    I always use these tools in the stdout redirecting form, e.g.:

    bunzip2 -c enwiki.bz2 > enwiki

    so the issue doesn't arise, (and I don't lose the original file). I guess your
    -k option has a similar effect.

     
  • Nouf Khalid

    Nouf Khalid - 2011-05-07

    Thank you very much...

    I appreciate your replies...
    You were right, the OP doesn't have permission for the directory in which I was trying to save the output file... I used another directory and it worked...
    
     
MongoDB Logo MongoDB