Menu

7z is just so depressing

2019-03-17
2019-03-28
  • Peter Smith

    Peter Smith - 2019-03-17

    The vanilla requirement is for a tool which archives files with relative file names with the ability to specfy which files are archived.

    It took 10 years to recognise that this was the case and then the -spf switch was introduced to do this.

    BUT THEN IT DOES NOT WORK!

    7z a -spf -i@index bs.7z
    7z a -spf bs.7z @index

    Both say

    WARNING: The system cannot find the file specified.
    bs

    0 files, 0 bytes

    Creating archive: bs.7z

    Items to compress: 0

    Files read from disk: 0
    Archive size: 32 bytes (1 KiB)

    Scan WARNINGS for files and folders:

    bs : The system cannot find the file specified.

    Scan WARNINGS: 1

    Usually the profit motive makes software not be helpful but what is going on here.

    Why would anybody want the ability to append to archives, flatten directory striuctures,
    (set the CPU thread affinity mask!), or do 95% of what is offered.

    By why oh why when we want to do the simple thing in a hurry we are so let down likke this?

    So now I have to maintain a dos version of tar just to get round this.

    How can intelligent people delude themselves so profoundly?

     
    • Andrzej P. Wozniak

      Reading help is sooo boooring, but inteligent people do RTFM and follow it before complaining…

      For example:
      - Use full paths to ensure the proper files are read
      - Use recursion for subdirectories
      - Use proper wildcards

      "%ProgramFiles%\7-zip\7z.exe" a c:\test\bs.7z -ir@C:\test\index -spf

       

      Last edit: Andrzej P. Wozniak 2019-03-17
  • Igor Pavlov

    Igor Pavlov - 2019-03-17

    So show index file also.
    If index contains bs, and 7-Zip can't find bs file, 7-Zip shows error message.
    Why you don't like it?

     
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    I am very appreciative of your reply.

    I have a file called index.

    I want to create a file called bs.7z which contains the files in the index with the files recorded as having their relative path.

    So, for instance if index contains

    a/x.c
    b/x.c

    I want the archive bs.7z to contain

    a/x.c
    b/x.c

    I would even be happy if the index contained

    a/x.c
    b/x.c_

    What command do I type at the MSDOS prompt to achieve this.

    I have googled for it.

    https://superuser.com/questions/545442/how-do-i-archive-with-subdirectories-using-the-7-zip-command-line-or-how-do-i

    It says

    the command 7z a p.7z -spf @list.txt will produce an archive storing the absolute paths as is in the list.

    BUT IT DOES NOT WORK!

    Kind Regards

     
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    I have tried 7z 15.14 and 7z 15.19

    Regards

     
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello

    RTFM -- There isnt one. (Google for it!)

    -ir@file What does that mean, am I supposed to guess?

    Anyway it does not work

    C:\linux\bs>7z a test.7z -ir@index -spf

    7-Zip [32] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31

    Scanning the drive:

    WARNING: The system cannot find the file specified.
    bs

    0 files, 0 bytes

    Creating archive: test.7z

    Items to compress: 0

    Files read from disk: 0
    Archive size: 32 bytes (1 KiB)

    Scan WARNINGS for files and folders:

    bs : The system cannot find the file specified.

    Scan WARNINGS: 1

     
    • Andrzej P. Wozniak

      RTFM -- There isnt one. (Google for it!)

      Using Google for local files? Very interesting…
      It's "R" (Read your help local file) here, not "S" (Search for help in the Internet).
      Run 7zFM and press F1. Or open console (cmd) window and type 7z -?
      Still any problems with reading?

      And once again:
      - Use recursion for subdirectories (switch r in command line).
      - Use proper paths in command line and in list file. If you aren't sure, always start tests with absolute paths. If you are sure, still do the same. Only then you can try to use relative paths and wildcards.

       

      Last edit: Andrzej P. Wozniak 2019-03-17
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    bs is not in the fie index.

    Regards

     
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    This looks like a buffer overrun problem.

    The attached file fails but if

    ./tcap_reserve.h

    is changed to

    tcap_reserve.h

    then it succeeds.

    Regards

     
    • Andrzej P. Wozniak

      What OS do you use? Why there are Unix-style paths used in index file?

       

      Last edit: Andrzej P. Wozniak 2019-03-17
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    Maybe not buffer overrun.

    A much simpler example.
    The example below fails but if
    ./b/x.c_
    is changed to
    b/x.c_

    then it succeeds

    --File index -----------------------------------
    index
    a/x.c
    ./b/x.c_

    --Fails -----------------------------------
    7-Zip [32] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31

    Open archive: pjs.7z

    Path = pjs.7z
    Type = 7z
    Physical Size = 253
    Headers Size = 185
    Method = LZMA2:12
    Solid = +
    Blocks = 1

    Scanning the drive:

    WARNING: The system cannot find the file specified.
    test

    2 files, 50 bytes (1 KiB)

    Updating archive: pjs.7z

    Items to compress: 2

    Files read from disk: 2
    Archive size: 272 bytes (1 KiB)

    Scan WARNINGS for files and folders:

    test : The system cannot find the file specified.

    Scan WARNINGS: 1

     
  • Peter Smith

    Peter Smith - 2019-03-17

    Hello,

    The operating system are Windows XP, and Windows 10.

    7z -? includes no explanation of the meaning of the switches.

    Regards

     
  • mdadm

    mdadm - 2019-03-28

    Open console (cmd) window and type: 7z.exe to see program options.
    If that don't work, go to directory where 7-Zip is installed (for example):
    cd "C:\Program Files\7-zip\" or
    cd "%Program Files%\7-zip\"
    or writing a few begining lettrs of directory and pressing TAB key on keyboard:
    C:\WINDOWS\Users\user> "C:\Program Files\7-zip\7z.exe"

    Most interesting options for you may be:
    -i[r[-|0]]{@listfile|!wildcard} : Include filenames
    -x[r[-|0]]{@listfile|!wildcard} : eXclude filenames
    -r[-|0] : Recurse subdirectories
    -spf : use fully qualified file paths

    Go to your directory (all in cmd):
    C:\linux\bs where you write you have
    a/x/c b/x/c
    and add it to index file, for example:
    a/x/c b/x/c
    Now you may try:
    7z a test.7z -ir@index
    or
    7z a -spf test.7z -ir@index

     

    Last edit: mdadm 2019-03-28

Log in to post a comment.