new simple packer plugin

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

Moderators: white, Hacker, petermad, Stefan2

gigaman
Member
Member
Posts: 131
Joined: 2003-02-14, 11:28 UTC

Post by *gigaman »

TC calls 16-bit wc32to16, and wc32to16 simply calls Int21 (probably using the DOS3CALL function, exported from the 16bit kernel).
However, TC sets LastWriteTime only...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, wc32to16 calls DOS3CALL because there is no official documented 32-bit function to call int21h from 32-bit code. And indeed TC sets Last write time only. Why?
- Creation time should be set to the time when the file/dir was really created
- Access time is changed by windows anyway when you write to the dir
- Last write time should be preserved, because the file wasn't really modified when copied...
dates are first changed but if you enter in one of this directory, date changes automatically
This means that you copied some files to the folder AFTER setting its date. I made the same error in TC 6.0. Solution: create the folder, then copy its contents, and only after copying set its date.
Author of Total Commander
https://www.ghisler.com
User avatar
fg_2002fr
Senior Member
Senior Member
Posts: 267
Joined: 2003-02-24, 10:12 UTC
Location: Tours (France)
Contact:

Post by *fg_2002fr »

Please Christian, could I use wc32to16 to change date and time of a directory under win9x? and how can I do ?
create the folder, then copy its contents, and only after copying set its date.
yes, that's what I did in ver 1.02
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes you can. Here is some Delphi code from TC which shows how to call wc32to16:

Code: Select all

type TSetAttrStruct=packed record
    setmode:longint;
    datetime:longint;
    filename:array[0..259] of char;
  end;

const WincmdSetDate='Wincmd32to16App';
var buf:array[0..MAX_PATH-1] of char;
    cds:tCopyDataStruct;
    tds:TSetAttrStruct;
    wait:integer;

  wnd:=FindWindow(WincmdSetDate,WincmdSetDate);
  if wnd=0 then begin
    strplcopy(buf,paramstr(0),sizeof(buf)-1);
    p:=StrRScan(pch,'\');
    if p<>nil then p[1]:=#0;
    strlcat(buf,'wc32to16.exe',sizeof(buf)-1);
    if ShellExecute(hwindow,'open',buf,'wincmd32','c:\',sw_hide)>=32 then begin
      wait:=0;
      repeat
        sleep(100);
        wnd:=FindWindow(WincmdSetDate,WincmdSetDate);
        inc(wait);
      until (wnd<>0) or (wait>=30);
    end else TryLoadDateSet:=false;
  end;
  if wnd<>0 then begin
    cds.dwData:=1;
    tds.setmode:=changedatetime;          {1=date, 2=time, 3=both}
    tds.datetime:=SetTheTime;
    chartooem(changename,tds.filename);   {Must be DOS name!}
    cds.cbData:=sizeof(tds);
    cds.lpData:=@tds;
    SendMessage(wnd,wm_copydata,0,longint(@cds));
  end;
Author of Total Commander
https://www.ghisler.com
gigaman
Member
Member
Posts: 131
Joined: 2003-02-14, 11:28 UTC

setting the directory timestamp from Win32

Post by *gigaman »

If anybody is interested in the code that makes it possible to call the necessary INT21 function directly from Win32 code, it can be downloaded here:
http://www.fortunecity.com/skyscraper/sunplace/289/settime.htm
User avatar
fg_2002fr
Senior Member
Senior Member
Posts: 267
Joined: 2003-02-24, 10:12 UTC
Location: Tours (France)
Contact:

Post by *fg_2002fr »

This new version support preservation of date under win9x
and use Wc32to16.exe program ( thanks to C. Ghisler)

You can download it here:
http://physio-a.univ-tours.fr/tcplugins/wcx_dircpy103.zip
Size: 8 KB

to gigaman
I tried your code, and effectively, it works ... sometimes. it is why I would rather use dos3call from Christian.
however, if you found why it doesn't work, please, inform me.
gigaman
Member
Member
Posts: 131
Joined: 2003-02-14, 11:28 UTC

Post by *gigaman »

Well, I believe the code should work the same as w32to16.exe (though I didn't actually test). I.e., it should set the LastWriteTime correctly (just pass NULL for the other timestamps)... or it doesn't?
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

Dear Francois,
I was wondering if it would be possible to add an option in the configurations of DirCopy where we'll be able to define the depth level of the directory copying.

70% of the cases I need to use DirCopy to recreate the structure of my software tools collection in order to keep it updated with future releases. Now, most of the times though I only need two dir levels to be copied, one which is the category and one which corresponds to the individual tools. But most of the times I have folders deeper down the dir structure which I don't actually need.

Here's an example:

MULTIMEDIA TOOLS
...|__WINAMP PLAYER
......|__SKINS
......|__PLUG-INS

Now, it would be nice to be able to configure DirCopy to copy dirs only two levels down (depending from where I'm executing DirCopy) so that my destination panel will only hold this structure:

MULTIMEDIA TOOLS
...|__WINAMP PLAYER

Can this be possible in the future? Thanks!
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
fg_2002fr
Senior Member
Senior Member
Posts: 267
Joined: 2003-02-24, 10:12 UTC
Location: Tours (France)
Contact:

Post by *fg_2002fr »

Hello panos!

Yes I think I could modify Dircopy to run your way
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

fg_2002fr wrote:Hello panos!

Yes I think I could modify Dircopy to run your way
Thanks a lot! :)
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
fg_2002fr
Senior Member
Senior Member
Posts: 267
Joined: 2003-02-24, 10:12 UTC
Location: Tours (France)
Contact:

Post by *fg_2002fr »

it's done, but I haven't test anymore.

You can download it here:
http://physio-a.univ-tours.fr/tcplugins/wcx_dircpy104.zip
Size: 9 KB

1.04 - 04.11.2004
- Added : "Choose Depth" option
- Added : automatic plugin installation (TC 6.5 and above)
thuan ha
Junior Member
Junior Member
Posts: 2
Joined: 2018-06-05, 02:03 UTC

Failed by FILE NAME

Post by *thuan ha »

I am using Dir Copy ver 1.10.
I see the window like this:
h-t-t-p-s-:-/-/-g-o-o-.-g-l-/-1-h-c-f-G-4

(delete all -)
It mention error in FILE NAME, but we need copying FOLDER NAME only. Why is it affected?


Edit by mod:
https //goo.gl/ 1hcfG4
https://goo.gl/1hcfG4

Example:
folder\folder name\foldername\file name with Ö and Ä.ext
Error because of the Ö and Ä in FILEname. Why that, as we copy folder structure only?
Post Reply