Rename inside archive

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Rename inside archive

Post by *Dec »

Why WCX plugin interface does not provide rename functionality?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Perhaps because most archivers don't allow that.
User avatar
chriss
Senior Member
Senior Member
Posts: 221
Joined: 2003-02-12, 10:17 UTC

Re: Rename inside archive

Post by *chriss »

Dec wrote:Why WCX plugin interface does not provide rename functionality?
I would say this is because none of this Tools/Plugins works inside an archive. If you change something inside an in really it unpacks temporary and repacks it again. An renaming operation would happen inside therefore it isnt possible.
gruß


chriss
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

MVV wrote:Perhaps because most archivers don't allow that.
If structure of archive allows user to rename a file inside archive (for example file list is stored at the end of the file of archive and rename operation does not require to rewrite whole archive) imho it will be good idea to add rename functionality to WCX interface. If plugin implements rename function - user can use it. If don`t - user will use "classic" way with with creation of the new archive and coping content of old to new.
chriss wrote:If you change something inside an in really it unpacks temporary and repacks it again.
Realization of rename functionality is plugin specific. If plugin author want to implement it - his rename function will do all unpack/pack operations much more efficient and fast than Total Commander and user.
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

ghisler, could you explain your point of view? You implemented rename functionality inside ZIP archives. Why don`t you want to add the same for other WCX plugins?
User avatar
chriss
Senior Member
Senior Member
Posts: 221
Joined: 2003-02-12, 10:17 UTC

Post by *chriss »

Dec wrote:
chriss wrote:If you change something inside an in really it unpacks temporary and repacks it again.
Realization of rename functionality is plugin specific. If plugin author want to implement it - his rename function will do all unpack/pack operations much more efficient and fast than Total Commander and user.
sure?

well - i´m no coder, but if it would be as simple as setting a switch or so i believe most of the coder whould be do it.
but if this means to rewrite a tool/plugin/whatever - i´m not sure....
gruß


chriss
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

chriss wrote:sure?
I am developer so I am sure.
chriss wrote:if it would be as simple as setting a switch or so i believe most of the coder whould be do it.
but if this means to rewrite a tool/plugin/whatever
No one can force the programmers to update their plugins. But add rename functionality is not the same as rewrite whole plugin.

Still waiting for ghisler comment.
User avatar
chriss
Senior Member
Senior Member
Posts: 221
Joined: 2003-02-12, 10:17 UTC

Post by *chriss »

Dec wrote:Still waiting for ghisler comment.
i understood already that you await and expect an answer from christian ;)
Dec wrote:
chriss wrote:sure?
I am developer so I am sure.
well - you know the default answer "if you miss something - code it yourself"
gruß


chriss
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

Dec wrote:"if you miss something - code it yourself"
It is not a problem for me to develop additional functionality in my plugins. But without integration with TC any new additional code is useless. Who will call my rename function?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48113
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Renaming is problematic when the length of the name changes - normally the entire archive has to be copied to adjust to the new name length. Some archives may even need complete re-packing, e.g. solid 7zip. There is currently no plugin function for renaming. All plugins would have to be updated to support it, which is very unlikely.
Author of Total Commander
https://www.ghisler.com
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

ghisler(Author) wrote:Renaming is problematic when the length of the name changes - normally the entire archive has to be copied to adjust to the new name length. Some archives may even need complete re-packing, e.g. solid 7zip.
Problematic does not mean impossible. And there are a lot of "archive" files in which rename function is easy to implement. Different disc WCX and etc.
ghisler(Author) wrote:There is currently no plugin function for renaming. All plugins would have to be updated to support it, which is very unlikely.
Why don`t you want to add rename interface for developers who can and want implement it. When plugin does not implement DeleteFile - TC just shows "Not available" (or something like this, I don`t remember). And when plugin does not implement RanameFile - just show the same message.

If you add rename interface there is a chance that developer will update plugin and end user will have rename functionality. But if you don`t add - there are no chances at all.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

solid 7zip
In solid archives only file contents is streamed, not file attributes - they are in a table so only this table should be recompressed (and of course all data needs to be shifted).
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
Renaming is problematic when the length of the name changes - normally the entire archive has to be copied to adjust to the new name length. Some archives may even need complete re-packing, e.g. solid 7zip.
I think this is something that the plugin author can decide.
All plugins would have to be updated to support it, which is very unlikely.
I currently don't see why it cannot be optional.
Dec
Member
Member
Posts: 115
Joined: 2006-11-23, 12:48 UTC

Post by *Dec »

Is there any chance this request will be added in the next version of Total Commander?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48113
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm indeed considering it for TC9, although there are still some unresolved problems like handling of the GetPackerCaps function - TC currently stores the flags in the wincmd.ini and does NOT update them when installing a newer version of the plugin.
Author of Total Commander
https://www.ghisler.com
Post Reply