ZipToZero (WCX packer plugin: store file name only with size=0 to archive) Zero-byte file

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

ZipToZero (WCX packer plugin: store file name only with size=0 to archive) Zero-byte file

Post by *Stefan2 »

Packer plugin to create a default zip archive but with zero-byte files only. 


Zip2Zero - WCX plugin for Total Commander
by *tbeu » Thu Jun 27, 2019 16:06 (please see a few posts below)

* Description:
---------------
Zip2Zero is a packer plugin for Total Commander to zip directory/file structures
as zero-byte files for convenient exchange of directory/file names.




Short how-to:
- Download the Zip2Zero packer plugin >> http://totalcmd.net/plugring/zip2zero.html
- Double click the downloaded ZIP archive while inside of TC
- - Plugin will install as an packer plugin and create an own file type "zip0" for use with pack-dialog

Usage:
- Select some files or folder
- Execute Pack-dialog in menu "Files > Pack..."
- As "Packer", chose from the drop-down menu "zip0" (zip-to-zero) Type
- If wanted, adjust the output path and remove the target path to create the zip in current active panel.

Please note that those costume file types like zip0 are only used internally for to handle the wanted plugin.
The plugin will create an default ZIP archive with the file type extension ZIP.

Purpose:
The purpose of this plugin is to store file names like an ordinary archive but with the information of size is 0 byte.
That way we can pack and share file name and folder hierarchy information to recreate on other PCs without to waste disc space.
The idea was to help peoples to share there local environment to helpers on the forum, which can now easily recreate what the people see at home.

- - -
FAQs: ENGLISH Plugins- Find / Installing / Removing a plugin:
viewtopic.php?p=294671#p294671
FAQs: DEUTSCH TC Plugin Add-On AddOn Externe Tools verwenden
viewtopic.php?p=342114#p342114






Original post

Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

I am on the search for an developer who are willing to create such an plugin:


Packer plugin to create a default zip archive but with zero-byte files only.

Only store paths and file names plus timestamps (optional?).
Maybe optional store files size as content to each file?
Unicode support please.
No funny things, keep it simple, like real zip packer.
For Windows 7 or younger.


Useful to exchange file names and to store and recreate folder structures.

Later on, use the default zip function to inspect or extract the archive.

Any taker or hint to (simple!) existing plugins or (freeware,portable) tools? :D

- - -

Zero-byte file - Wikipedia:
A zero-byte file or zero-length file is a computer file containing no data;
that is, it has a length or size of zero bytes.
Zero-byte files cannot be loaded or used by most applications.


 
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *petermad »

License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Stefan2 »

2petermad

No, they do not create ZIP archive files ;-)


So it's hard to recreate the folder structure.


But thanks for listing this tools :thumbsup:
 
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Usher »

2Stefan2
To me the main problem is that you cannot use the same select filters for normal copy and for copy from archive or for unpack. I suppose you wouldn't request a plugin, if you could select "Copy directory only" from some DiskDir* list or from zip file.
You can only use flat view (Ctrl+B) to select needed files to pack/unpack (copy to/from archive), but there are only files listed there, no directories. Other filters aren't available.
You can use Ctrl+F12 to predefine "Directory only" as a custom selection type, but you can't use such a selection to pack/unpack or to copy to/from archive. It's a missing TC feature rather than a missing plugin.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *LonerD »

AHK script DirFilesStructure.ahk
No compression, but with filedirs structure (with optional timestamps and files size)

Code: Select all

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Total Commander DreamLair                        ;
; Script: Create directories and files structure   ;
; Скрипт: Створення структури каталогів та файлів  ;
; Скрипт: Создание структуры каталогов и файлов    ;
; Script version: 1.2 (2019.01.31)                 ;
; Required: Total Commander 9.0+                   ;
; Script author: LonerD                            ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Parameters / Параметри / Параметры:              ;
;   %WL ( required )                               ;
;   "path_for_filestructure" ( required ) ("%T\" - target panel)
;   1 - create also files structure                ;
;   t - save timestamps                            ;
;   s - save filesizes for files                   ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
; Example / Приклад / Пример:                      ;
;   %WL "%T\" 1 t s                                ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;

#NoEnv
#NoTrayIcon
#SingleInstance ignore
SetKeyDelay, 20, 20

if not ( WinExist("ahk_class TTOTAL_CMD") || WinActive("ahk_class TTOTAL_CMD") )
  ExitApp
WinGet, hw_TTOTAL_CMD, ID, A
global hw_TTOTAL_CMD

if 0 < 2
  ExitApp
Filelist = %1%
CreatePath = %2%
if !InStr(FileExist(CreatePath), "D")
  ExitApp
if 0 < 3
  CreateFiles = 0
CreateFiles = %3%
if 0 < 4
  SetTime := "t"
SetTime = %4%
if 0 < 5
  SetSize = 0
SetSize = %5%

TCAPanel := SendMessageTC(1074, 1000, 0, A)
hw_TCAPanel := SendMessageTC(1074, 8+TCAPanel, 0, A)
ControlGetText, TCAPanelPath,, % "ahk_id " hw_TCAPanel
TCAPanelPath := StrReplace(TCAPanelPath, "\*.*", "\")

FilelistV =

Loop, Read, % Filelist
{
  FilelistV := FilelistV . A_LoopReadLine . "`r`n"
  TargetFile = %A_LoopReadLine%
  SplitPath, TargetFile, FileName, FileDir
  if InStr(FileExist(TargetFile), "D")
  {
    Loop, Files, %TargetFile%*.*, FDR
    {
      if InStr(FileExist(A_LoopFileFullPath), "D")
        FilelistV := FilelistV . A_LoopFileFullPath . "\`r`n"
      else
        FilelistV := FilelistV . A_LoopFileFullPath . "`r`n"
    }
  }
}

Loop, Parse, FilelistV, `n, `r
{
  NewZeroFile := StrReplace(A_LoopField, TCAPanelPath, CreatePath)

  LastChar := SubStr(NewZeroFile, 0)
  if ( LastChar = "\" )
    FileCreateDir, % NewZeroFile
  else if ( CreateFiles = 1 )
  {
    SplitPath, NewZeroFile, FileName, FileDir
    if !InStr(FileExist(FileDir), "D")
      FileCreateDir, % FileDir
    FileSize := ""
    if ( SetSize = "s" )
      FileGetSize, FileSize, %A_LoopField%
    FileAppend, % FileSize, % NewZeroFile
  }
}

if ( SetTime = "t" )
{
  Loop, Parse, FilelistV, `n, `r
  {
    SourceFile := A_LoopField
    LastChar := SubStr(A_LoopField, 0)
    if ( LastChar = "\" )
    {
      StringLen := StrLen(A_LoopField)
      SourceFile := SubStr(A_LoopField, 1, StringLen - 1)
    }

    NewZeroFile := StrReplace(SourceFile, TCAPanelPath, CreatePath)
    FileGetTime, FileTime, % SourceFile
    FileSetTime, % FileTime, % NewZeroFile
  }
}

FilelistV =
ExitApp

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
SendMessageTC(TCMsg, wParam, lParam, aControl)
{
  SendMessage, % TCMsg, % wParam, % lParam, % aControl, % "ahk_id " hw_TTOTAL_CMD
  return ErrorLevel
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Stefan2 »

Thanks LonerD.



For others, I am on the search for a Packer plugin to create a zip archive


Something like that:
http://www.dcmembers.com/skwire/download/zero-zipper/
Zero Zipper
2012-02-29 by skwire
Description: Duplicate a folder/file structure as zero-byte files and then create a zip from them.




 
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *tbeu »

Stefan2 wrote: 2019-01-31, 19:15 UTC For others, I am on the search for a Packer plugin to create a zip archive
You might want to give the new Zip2Zero packer plugin a try. :idea:
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Stefan2 »

Thank you very much, Thomas.

Now people who wants to re-order their file/folder structure or have renaming requests
can post their zerozipped examples and we can easily re-create them on our system.

Well done :thumpsup: ... at least the 32-bit wcx works here nice.

(May also work for to create 0-byte files if need)


First post updated with information to this plugin

 
 
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *tbeu »

Thanks. When tested, compared to the zero-zipper tool by skwire that which you linked above, the plugin creates smaller zip archives and runs faster since no temporary files are created.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
thomasmolover
Member
Member
Posts: 160
Joined: 2016-12-12, 01:32 UTC

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *thomasmolover »

If the folder name is in Chinese, there will be garbled characters in the compressed package made with this plugin.

https://drive.google.com/open?id=1d7inHcXrs-Jfn07UV5JIR9TwO9a8BeQJ
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *tbeu »

I could only reproduce for the path of the created zip file itself, but not for the contents (file or directory) within the created archive. Can you please test if Zip2zero 1.0.0.2 fixes the issue? My test data was test_bug_zip2zero.7z.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
thomasmolover
Member
Member
Posts: 160
Joined: 2016-12-12, 01:32 UTC

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *thomasmolover »

tbeu wrote: 2019-07-03, 10:41 UTC I could only reproduce for the path of the created zip file itself, but not for the contents (file or directory) within the created archive. Can you please test if Zip2zero 1.0.0.2 fixes the issue? My test data was test_bug_zip2zero.7z.
the version works correctly!! thanks!!
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *tbeu »

thomasmolover wrote: 2019-07-03, 15:58 UTC the version works correctly!! thanks!!
Thanks for confirmation. Zip2Zero 1.0.0.4 is officially released now.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
Phred
Senior Member
Senior Member
Posts: 375
Joined: 2009-06-16, 15:24 UTC
Location: SEAu

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Phred »

This looks great - the next best thing to 'duplicating' zero-byte files in the opposite list panel - as place-holders or records of their existence - BUT I'm finding that that resultant zip file doesn't retain the zip0 extension displayed in the dialogue box before the zipping action.
Is this intentional?

Nevertheless, thanks.
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
User avatar
Phred
Senior Member
Senior Member
Posts: 375
Joined: 2009-06-16, 15:24 UTC
Location: SEAu

Re: Plugin request - ZipToZero (WCX packer plugin: store file name only to archive)

Post by *Phred »

.
For those reading who don't know how to use this add-on:

Install it normally by double-clicking on the downloaded add-on zip file
Answer Yes to installing it, providing admin permissions if you're (sensibly) not signed in as an admin
Ok the resultant dialogues away and exit-up out of the add-on zip file
Now select a few files, then Alt-F5 or Files, Pack in the menu (also in long right-click)
In the last radio-button on the right, its dropdown, choose zip0 as the method of packing
(Note that currently the displayed .zip0 extension isn't carried through to the result)
(Choose zip0 each time you use it; it isn't remembered.)(Alternatively, as long as your packed target/resultant file has a 'zip0' extension, the Zip2Zero add-on will be invoked by association; the radio-buttons are ignored.)
Ok.
'Move to zip' Alt-Shift-F5 can be used, but it doesn't make sense. And it does nothing extra. The Zip2Zero add-on just makes zero-length 'files' inside a zip file.
(The 'files' can be extracted elsewhere as, say, placeholders; they'll have a size of 0.)
HTH
Regards, PhredE
Licence holder since 1999
Awaiting a $D donors-token for the title-bar so we can display that we have donated further.
Post Reply