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

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

Moderators: Stefan2, white, sheep, Hacker

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

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

Post by *Stefan2 » 2019-01-29, 11:26 UTC

 
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.


 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

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

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

Post by *petermad » 2019-01-29, 13:00 UTC

License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b5 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
Stefan2
Power Member
Power Member
Posts: 2512
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 » 2019-01-29, 13:26 UTC

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:
 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
Usher
Senior Member
Senior Member
Posts: 402
Joined: 2011-03-11, 10:11 UTC

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

Post by *Usher » 2019-01-29, 14:45 UTC

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.
Regards from Poland
Andrzej P. Wozniak

User avatar
LonerD
Senior Member
Senior Member
Posts: 298
Joined: 2010-06-19, 20:18 UTC
Location: Donetsk

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

Post by *LonerD » 2019-01-31, 14:48 UTC

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
}
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
Total Commander DreamLair - dream always, think totally, be the commander of you own life.

User avatar
Stefan2
Power Member
Power Member
Posts: 2512
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 » 2019-01-31, 19:15 UTC

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.




 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
tbeu
Power Member
Power Member
Posts: 1252
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 » 2019-06-27, 14:06 UTC

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 Preview, Autodesk Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

User avatar
Stefan2
Power Member
Power Member
Posts: 2512
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 » 2019-06-27, 14:29 UTC

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.


 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
tbeu
Power Member
Power Member
Posts: 1252
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 » 2019-07-02, 08:05 UTC

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 Preview, Autodesk Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

User avatar
thomasmolover
Member
Member
Posts: 104
Joined: 2016-12-12, 01:32 UTC

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

Post by *thomasmolover » 2019-07-03, 03:20 UTC

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: 1252
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 » 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.
TC plugins: Autodesk 3ds Max Preview, Autodesk Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

User avatar
thomasmolover
Member
Member
Posts: 104
Joined: 2016-12-12, 01:32 UTC

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

Post by *thomasmolover » 2019-07-03, 15:58 UTC

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: 1252
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 » 2019-07-06, 19:22 UTC

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 Preview, Autodesk Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, SolidWorks Preview and more

Post Reply