RAR files with different extension

I'm having some problems with RAR files that have an extension that is not ".rar".

Scanned comics are usually stored in CBR or CBZ files, which are simply renamed RAR (cbr) or ZIP (cbz) files.
I added CBZ to the ZIP System File Types extensions, and CBR to the RAR System File Types extensions. Both of them are also added to the DirOpus "Archives" File Type Groups.

Now, everything seems to work well with CBZ (zip) files. I can browse the archives in DirOpus like any other zip. This does not seem to work with CBR (rar) files, Opus just opens a new lister that points to the containing folder. If I rename the file extension to .rar I can browse the file without problems.

Do I have to change something in my settings, or is the .rar extension kind of hardcoded in the rar-handling?

The RAR extensions are hardcoded, but I'll look into adding .CBR (making sure people can remove it if they want it to be handled by something else without disabling RAR in Opus entirely).

Thanks Leo.

Any news about this feature ?

I have a lot of comics stored in .CBR format but I cant browse them using built-in Opus plug-in version 10. I was able to do with version 9.

Thanks in advance.

Does this work:

Settings
File Types
File Type Groups
Compressed files
Edit
Extensions
Add .cbr

Also look for the "Preview Handler" that deals with .rar files and adjust accordingly?

I don't think that'll work MK... firstly, if you have a "File Type Group" called "Compressed files" it sounds like something you added to Opus yourself. There is an "Archives" group by default that you can make changes to... but either way, doing anything at that level doesn't in and of itself tell Opus to use the 7z plugin to treat cbr extensions as RAR files.

Leo's 7z plugin has to tell Opus which file extension the plugin handles, and then it's up to the plugin to figure out how to treat a non-standard extension as a particular type of archive. Without the plugin itself registering a specific extension, configuring Opus to do archive stuff with the extension probably causes Opus to try treating it like a standard ZIP archive - which of course will bomb out on something that is actually a RAR file.

Ideally, Leo could add an interface to the plugin to allow us to specify our own extensions to be treated as particular archive types... such as how we can do inside of Prefs for Opus internal ZIP file support... but that'd be more work, where hard-coding CBR would get us by. And I think that it's FAR more common for various applications to make use of ZIP format archives with ~crazy non-standard extensions (such as Opus itself) as opposed to RAR.

I guess Leo's answer deals with it. Strangely, that wasn't there when I chipped in. (Something to do with timing I guess.) Or I wouldn't have intervened.

Would an interim solution be to find and rename all .CBR files?

If they really are just disguised RAR files, that might work.

Could even "button" it.

That is indeed what I actually do at the moment (rename from cbr->rar and cbz->zip)... but there could be a good reason ppl might want to leave the extension as cbr so as to differentiate them as comic book archives. So, if Leo could make the hard coded change relatively easily, I think that'd be preferable.

I'm not sure where this thread's going - and I don't understand much of it because I don't have a tech background - but I know it relates to my problem.

I want to freely do batch (from 1 - 100+ selected files at a time) renames of file extensions in all of these cases:

  1. rar --> cbr
  2. zip --> cbz (available now under Rename button)
  3. cbr --> rar
  4. cbz --> zip

If the ability to do it with just 1 or 2 clicks has been made available in the last 2 or 3 months, could someone explain to me how to do it?

I did successfully (after reading someone else's Opus thread) create a button to changespaces to underscores for all selected/highlighted files.
It's perfect and so efficient and I love it.
In my innocence, I thought it would work for file type/extensions as well. But no.
Still, that one-click solution would be ideal if it could be made to work by my just changing the "commands" (?) in the edit box.
Yes, I know I'm probably comparing apples and lemons.

Could I have some non-tech comment please?

Thanks for your help (and patience), folks.
:smiley:

[quote]I want to freely do batch (from 1 - 100+ selected files at a time) renames of file extensions in all of these cases:

  1. rar --> cbr
  2. zip --> cbz (available now under Rename button)
  3. cbr --> rar
  4. cbz --> zip[/quote]

It's not entirely related to the thread (people want to be able to go inside of .cbr files without renaming them to .rar), but it's easy to answer.

Here's the button code. You can make two buttons which handle the renames in one direction or the other. i.e. You don't need 4 buttons to handle the 4 different cases (2 in each direction).

(The first line is optional, but it's usually nice to keep the files selected after they are renamed.)

@nodeselect Rename PATTERN=*.rar TO=*.cbr Rename PATTERN=*.zip TO=*.cbz

@nodeselect Rename PATTERN=*.cbr TO=*.rar Rename PATTERN=*.cbz TO=*.zip

The reason it didn't work with the FINDREP argument is that Find & Replace mode ignores the file extension by default. You could use FINDREP=ext to change that, but you're better off using a wildcard rename like in my buttons above, otherwise if the names happen to have ".zip" or similar in the middle of them, that would be changed as well, which you don't want.

Looks like you are using the default toolbars, so you already had that command in the menu that's attached to the Rename button. There might be some other things in there that are useful.

Re the original request in this thread, that will be done in the next Opus update for both .cbr (RAR Comic Book) and .cb7 (7z Comic Book) archives.

Here's how it will work in 10.0.3.3-beta and 10.0.4.0-stable:

[ul][li]If you don't have anything associated with the .cbr and .cb7 extensions then double-clicking them in Opus will open them automatically.[/li]
[li]Otherwise, you need to add the extensions to Settings -> File Types -> File Type Groups -> Archives if you want Opus to take over double-clicks on them within Opus.[/li][/ul]
We assume that if you already have a program associated with them then you probably want to continue using it for double-clicks, so we won't take them over automatically.

You can always open the archives via the folder tree or manually entering their paths, if you only want to open them via Opus on rare occasions and via something else normally.

[quote]It's not entirely related to the thread (people want to be able to go inside of .cbr files without renaming them to .rar), but it's easy to answer.
Here's the button code...[/quote]
First, apologies for intruding in a thread that was different to my problem but, to my simple view of the world, it seemed very similar.
:slight_smile:

Second, a million thanks, Leo, for your solution and clear explanation.
It works fine and is really great!
There will be times when I want to select 100 files but only rename the RAR extensions (or the ZIP only) so I kept them separate -- ie. 4 buttons.
But I was thinking of adding your 2 "joins" as well, for versatility when I do want to rename all RAR + ZIP together.

It seems to me that - to save default toolbar space, I should be able to add the 4 or 6 buttons to the default Rename drop-down menu or create a new menu for the purpose?
(Actually, I have a 27" monitor and there's heaps of free space on the toolbar but a menu is probably more elegant, even if a menu requires 2 clicks instead of 1 with the buttons).
Anyway, I'll fiddle around with a menu and see if I can get it working as well; I might even use both (menu and buttons) for a while until I decide which is best for me.

Directory Opus is growing on me now as I realize how I can enslave it through customization.
Whips and manacles as I put it to work in the galley.
And I'm now motivated to explore it more and see all the possibilities below deck.
In fact, now I can't wait for my subscription to come due so I can renew it!
:smiley:
Thanks so much, Leo... for both the solution and the timeliness of the almost immediate reply.

Actually, the existing menu item is Underscores to Spaces and I needed to be able to go the other way as well.
I tried holding down as I clicked the menu item but no go: the selected file name didn't change.

:slight_smile:

Yep, you can do either.

While in Customize mode, open up the drop-down menu and simply drag whatever you want into it.

If you want to create a new menu instead, find an empty space on the toolbar somewhere, right-click, then choose the New -> New Menu option, then drag things in similarly.

Oops, my fault for misreading.

You could make it do the reverse when holding down shift if you want, using @keydown, but that's usually used to conserve space, which isn't really necessary in a drop-down menu. You can if you want, though.

Leo, thanks for adding these filetypes to work with the Opus archives function.

One question - is it possible to retain my current association with these files, but to add a button/hotkey command that will open (browse into) the files in Opus?
I currently have a hotkey to open them in WinRAR, but would prefer to open them in a lister, since it's so much easier to edit the contents from within Opus :slight_smile:

Yes, the current association is kept by default. If you want a button which navigates to them, I think you just need it to run the Go command without any other arguments. Or maybe Go FROMSEL or similar.

Hi, Leo
Help!
I'm trying to extend my renames (as above) by having a button to removing the leading "The " from all comic filenames, for "proper" alpha arrangement.
However, I can't seem to replace part of it with "nothing".
eg.
@NODESELECT
Rename PATTERN="The " TO="" FINDREP

Opus seems to interpret that as "do nothing (give the file the same name as it had before)" and gives an error "Cannot create a file when that file already exists (183)"

Is it possible to rename part of a file to null?
Or delete part of it without deleting the file itself?

Thanks for help.
:slight_smile:

There's a special syntax for replacing with nothing (it's in the Rename command page in the manual), but I doubt you want to do a full search & replace on "The " anyway, since it would remove the word from all places in the filename, not just the start of it.

Also, Opus allows you to ignore "The " at the start of names when sorting so you don't have to remove it at all if you don't want to.

If you do want to remove it, use this:

Rename PATTERN="The " TO=""

(If you need any more help with renaming etc. please start a new thread so we can keep this one about its original topic.)