EMULAB Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The new forum is online, hope you enjoy it!

Pages: [1]   Go Down

Author Topic: 7z rebuild with @ in filename  (Read 6859 times)

Zandro

  • Member
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 40
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 18.0 Firefox 18.0
    • View Profile
7z rebuild with @ in filename
« on: 17 January 2013, 13:21 »

Dat entry:
<game name="@rkanoid Beta V0.01 by Ducker (PD)">
<rom name="@rkanoid Beta V0.01 by Ducker (PD).GBA" crc="<snip>" sha1="<snip>"/>
</game>


7zr.exe: a -y -r -ms=off -mx0 %1 %2


Same result with 7z.exe 9.30. Compress as .zip and .rar work OK. (Rar.exe: a -y -r -ibck -m5 -s- %1 %2)

a -y -r -ms=off -mx0 "%~1" %2 = Same error.
Rebuild log: B:\scan\@rkanoid Beta V0.01 by Ducker (PD).gba [SKIPPED Reason: Create Destination Problem]

a -y -r -ms=off -mx0 "%~1" "%~2" = the rom is counted as being created in post-rebuild statistics but the archive isn't found anywhere... apparently built into the nether.
B:\scan\@rkanoid Beta V0.01 by Ducker (PD).gba
  -> @rkanoid Beta V0.01 by Ducker (PD).7z\@rkanoid Beta V0.01 by Ducker (PD).GBA


a -y -r -ms=off -mx0 %1 "%~2" = archive is created in destination, but no entry added. Only 32bytes of 7z header is written.

a -y -r -ms=off -mx0 "%1" "%~2" = 32byte archive, but filename is truncated after space. (@rkanoid.7z)

a -y -r -ms=off -mx0 %~1 %~2 = counted as created in stats, but no archive in destination.

Changed Dat entry:
<game name="@rkanoid Beta V0.01 by Ducker (PD)">
<rom name="Arkanoid Beta V0.01 by Ducker (PD).GBA"

...Rebuild works fine with a -y -r -ms=off -mx0 %1 %2

Changed Dat entry:
<game name="@rkanoid Beta V0.01 by Ducker (PD)">
<rom name="&#64;rkanoid Beta V0.01 by Ducker (PD).GBA"

...Same error again.

"@" is used in MSBatch to mute output, but only if at the start of a line.  It is echo-able.  Is there a commandline that can make 7z behave with this character?  I cannot find references to this problem elsewhere.
« Last Edit: 17 January 2013, 13:36 by Zandro »
Logged


Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3292
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 24.0.1312.52 Chrome 24.0.1312.52
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #1 on: 17 January 2013, 13:38 »

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...] [<@listfiles...>]

The @ is used to use a listfile, so I guess 7zip gets confused...

You might try to specify .\%2 as clrmame 7z commandline parameter instead of %2...so maybe you can fool 7z by specifying the "current folder" (cmpro will add the file %2 from a current folder internally...)

..or maybe quotes around %2
« Last Edit: 17 January 2013, 13:39 by Roman »
Logged

Zandro

  • Member
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 40
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 18.0 Firefox 18.0
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #2 on: 17 January 2013, 13:43 »

Yes, a -y -r -ms=off -mx0 %1 .\%2 works!  Fool 7z twice, shame on it!  Thank you for the quick reply. :)
Logged

oxyandy

  • Member
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 269
  • Operating System:
  • Windows XP Windows XP
  • Browser:
  • Firefox 18.0 Firefox 18.0
    • View Profile
    • .
Re: 7z rebuild with @ in filename
« Reply #3 on: 21 January 2013, 15:13 »

So, can:
a -y -r -ms=off -mx0 %1 .\%2
be used in place of,
a -y -r -ms=off -mx0 %1 %2
Without any undesirable effects.. ?

What about delete & rename.. can the .\ be added ?
Is it needed.. could it be useful ?
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3292
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 24.0.1312.52 Chrome 24.0.1312.52
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #4 on: 21 January 2013, 15:36 »

I need to check when and where this is called. Usually cmpro moves a single file into a temporary folder, changes to that folder and calls the add or delete operation. That's why .\ doesn't harm in front of the filename since it is already "local directory".
If I remember correctly there is one case where cmpro adds multiple files...but even then it most likely only does a .\* then....
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3292
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 24.0.1312.52 Chrome 24.0.1312.52
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #5 on: 21 January 2013, 19:44 »

hmm...actually it should already handle @ at the beginning automatically....I've added an internal .\ fix for filenames starting with @ a long time ago...wonder why it did not work for the mentioned files...need to double check this.
And yes, currently it tries to remove the 'new_name' files first in case of a rename operation.....guess I can change this easily to do this only if the new_name does exist.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3292
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 24.0.1312.52 Chrome 24.0.1312.52
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #6 on: 21 January 2013, 20:57 »

ok I've checked the code and I can't repeat an issue with @ at filename start...so an added .\ is obsolete in my opinion... all operations (add, delete, rename) check (in case of 7z/7Z extension) if filenames start with an @....and in that case it automatically adds .\

So Zandro, can you send me a scenario (cmpro.ini, *.dat, *.cmp and the rom files in question) where I can repeat your issue?
Logged

Zandro

  • Member
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 40
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 18.0 Firefox 18.0
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #7 on: 22 January 2013, 06:29 »

PM sent.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3292
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 24.0.1312.52 Chrome 24.0.1312.52
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #8 on: 23 January 2013, 19:30 »

thanks...I found the reason :) Actually cmpro does test if the filename starts with an @ and automatically adds a .\ in front of it....however in your case, the filenames got spaces and cmpro automatically adds quotes around them...and then the @ test fails :)
Will be fixed in the next version, thanks for sending such a good scenario....till then you can safely use the .\%2 workaround
Logged

Zandro

  • Member
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 40
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 18.0 Firefox 18.0
    • View Profile
Re: 7z rebuild with @ in filename
« Reply #9 on: 23 January 2013, 19:32 »

Great, thanks again!  Cheers!
Logged
Pages: [1]   Go Up
 

Page created in 0.338 seconds with 20 queries.

anything