LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why can't compress files into target directory? (https://www.linuxquestions.org/questions/linux-newbie-8/why-cant-compress-files-into-target-directory-4175594249/)

luofeiyu 11-25-2016 11:52 PM

Why can't compress files into target directory?
 
Code:

pwd
/home/debian8
rar a  /tmp/imitation.rar  /home/imitation

RAR 4.20  Copyright (c) 1993-2012 Alexander Roshal  9 Jun 2012
Trial version            Type RAR -? for help

Evaluation copy. Please register.

ERROR: Bad archive /tmp/imitation.rar

rar a  imitation.rar  /home/imitation

ls  /home/debian8
imitation.rar

rar command can compress files into current directory.
Code:

rar a  imitation.rar  /home/imitation
#execute

rar command can't compress files into target directory,
Code:

rar a  /tmp/imitation.rar  /home/imitation
#can't execute

Why?

rigor 11-26-2016 01:36 AM

Tried rar with three different forms:
  1. Archive into a directory by listing individual files to archive.
  2. Archive into a directory by listing directory whose contents I wish to archive.
  3. Archive into /tmp by listing directory whose contents I wish to archive.

All three forms, worked, here's the output:

Code:

prompt> rar a bard/archive.rar a b c

RAR 5.40  Copyright (c) 1993-2016 Alexander Roshal  15 Aug 2016
Trial version            Type RAR -? for help

Evaluation copy. Please register.

Creating archive bard/archive.rar

Adding    a                                                          OK
Adding    b                                                          OK
Adding    c                                                          OK
Done
prompt> rar a bard/archive.rar da_files

RAR 5.40  Copyright (c) 1993-2016 Alexander Roshal  15 Aug 2016
Trial version            Type RAR -? for help

Evaluation copy. Please register.

Updating archive bard/archive.rar

Adding    da_files/b                                                  OK
Adding    da_files/c                                                  OK
Adding    da_files/a                                                  OK
Adding    da_files                                                    0%
Done
prompt> rar a /tmp/archive.rar da_files

RAR 5.40  Copyright (c) 1993-2016 Alexander Roshal  15 Aug 2016
Trial version            Type RAR -? for help

Evaluation copy. Please register.

Creating archive /tmp/archive.rar

Adding    da_files/b                                                  OK
Adding    da_files/c                                                  OK
Adding    da_files/a                                                  OK
Adding    da_files                                                    0%
Done

It might help if you could show us the actual attempts to execute the rar command, along with any output from each attempt, including any error-messages/complaints from the rar command.

ondoho 11-26-2016 04:34 AM

maybe the file /tmp/imitation.rar already exists?

jpollard 11-26-2016 04:37 AM

Or there is insufficient disk space for the output?


All times are GMT -5. The time now is 05:12 AM.