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: Scanner leaves behind empty folders.  (Read 5016 times)

nimrodeo

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Mozilla compatible Mozilla compatible
    • View Profile
Scanner leaves behind empty folders.
« on: 13 August 2015, 15:33 »

This question is about how the scanner treats empty folders.

There is an option on the scanner that allows the user to check for unused files and fix (remove) them.  I have found that the scanner only checks for unused files and does not check for unused or empty folders.  This came up when re-scanning a set that formerly had a hash name collision, but was changed by a MAMEdev to have unique names.  clrmamepro moved the file to the new name in the root of the .7z file, but the folder it formerly occupied (now empty), was left in the .7z file.  I found I could add any number of empty folders to a .7z file, let clrmamepro scan it, with the "fix unused" checkbox set, and clrmamepro leaves them in the .7z file.  I suppose this behavior could be an artifact of the communication with the 7-zip.exe file as specified in the compressor properties dialog, but I thought I would ask about it in case it was something that is being overlooked.  I'm using 7-Zip [64] 9.38 beta.
 
The file I found that this happened to is "fm7_cass\gbank.7z" in the MAME Software Lists.
 
Of course the rebuilder does not have this issue, it only rebuilds what is necessary and never adds the empty folders.  Certainly a valid work-around is to rebuild everything each time MAME is updated.  But that's going to take a long time, as the .7z file handling takes so much longer than the .zip file handling.

Thanks for entertaining my questions.  I realize these points are minor, and I understand if they are low priority to address, or not even worth addressing.
Logged


Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.155 Chrome 44.0.2403.155
    • View Profile
Re: Scanner leaves behind empty folders.
« Reply #1 on: 13 August 2015, 18:26 »

you might want to double check
Settings->Compressor->General->Mark useless folder structs as unneeded (Scanner only).
I try to generate a testcase for it to check it a bit more when I got some more time.

I'm trying to check these things maybe over the weekend. today was my oldest son's first day at school....so everybody is a bit tired ;-)
« Last Edit: 13 August 2015, 18:26 by Roman »
Logged

nimrodeo

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Mozilla compatible Mozilla compatible
    • View Profile
Re: Scanner leaves behind empty folders.
« Reply #2 on: 14 August 2015, 00:16 »

you might want to double check
Settings->Compressor->General->Mark useless folder structs as unneeded (Scanner only).
I try to generate a testcase for it to check it a bit more when I got some more time.

I'm trying to check these things maybe over the weekend. today was my oldest son's first day at school....so everybody is a bit tired ;-)
Congrats on your son's milestone.

Thanks for looking into this.  I've attached a copy of gbank.7z with the empty folder for your perusal.

I had forgotten it was there, so I have now double checked  the "Settings->Compressor->General->Mark useless folder structs as unneeded (Scanner only)."  But it was already set.

I'll try playing around with some of the other options while you are looking at it.  I'll check back next week unless I find something.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.155 Chrome 44.0.2403.155
    • View Profile
Re: Scanner leaves behind empty folders.
« Reply #3 on: 14 August 2015, 20:30 »

ah...I found out what happens...Actually cmpro does detect the obsolete folder but for 7z and rar it does an additional check (which in you case fails and that's the reason why the folder is not marked as unneeded).
7z/rar files folder structure are different from zip's. Zip files got an obsolete folder entry PLUS each file in that folder got the folder added to its filename. So for rom1,rom2, rom3 in subfolder puckman, you got
puckman/rom1, puckman/rom2, puckman/rom3 stored as filenames in the zip plus puckman as folder entry
In rar/7z files you don't have that (you only got the rom1,2,3 plus the information that these 3 files are stored in a folder named puckman).

Now cmpro does a check to see if an archive folder contains valid roms and if not the folder entry is not marked as unneeded. The check is a bit too lazy (actually only a slash is missing) and it fails for your combination where the setname is also a prestring of a romname...etc..blablablalbab..

fixed for next version
Logged

nimrodeo

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Mozilla compatible Mozilla compatible
    • View Profile
Re: Scanner leaves behind empty folders.
« Reply #4 on: 14 August 2015, 20:40 »

Great! thanks for fixing this.

I just tested this issue on the new release, it detects and removes the empty folder on plain .7z files.

It will also remove the empty folder on .t7z files, provided the version of 7-zip.exe is v 9.18 alpha, dated 2012-06-20.  When a newer version of 7-zip.exe is used, such as v 9.38 beta, dated 2015-01-03, the empty folder will be removed on plain .7z files, but not .t7z files.

This is no fault of clrmamepro, there is an issue with newer versions of 7-zip.exe.

So as far as I can tell, this issue is completely fixed.
« Last Edit: 15 August 2015, 00:34 by nimrodeo »
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 8.0 Safari 8.0
    • View Profile
Re: Scanner leaves behind empty folders.
« Reply #5 on: 15 August 2015, 06:00 »

the problem is not 7z but t7z....it does not create valid 7z structures
Logged
Pages: [1]   Go Up
 

Page created in 0.129 seconds with 20 queries.