ZIP Support (so I can finally retire "PowerDersk Pro")

Features wanted...
LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by LittleBiG »

I can :-( But the number of error messages during the compressing decreased to 2. Before it was many.

admin
Site Admin
Posts: 64836
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by admin »

Is your machine rather slow? Or are you working on a network drive?

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by LittleBiG »

admin wrote:Is your machine rather slow? Or are you working on a network drive?
I don't consider it slow. Older Pentium E6300, but dual-core 2.8 GHz.

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by Enternal »

There is another way that shows that XYplorer is doing post processing faster than it should. I just made a simplye Test.xys:

Code: Select all

  Zip_Add("Test.zip");
  Msg "Before Zip"
and put it in the script directory. Download: http://download.xnview.com/XnViewMP-win.zip and extract it somewhere. Then select that folder and then load the script. Drag the Windows zipping progress window out of the way and then you will see that the msg window pops up before the zipping even completely finish.

In terms of LittleBiG, I cannot reproduce it with the beta (on the old one yes). Going to do more testing later as well to see if it can be reproduce again.

EDIT: A more practical example is

Code: Select all

  Zip_Add("%DesktopReal%\XnViewMP.zip","%DesktopReal%\XnViewMP\");
  MoveTo "%DesktopReal%\Apps\", "%DesktopReal%\XnViewMP.zip";
EDIT: Nevermind. It seems to work for me now.

Code: Select all

  Zip_Add("%DesktopReal%\XnViewMP.zip","%DesktopReal%\XnViewMP\");
  //MoveTo "%DesktopReal%\Apps\", "%DesktopReal%\XnViewMP.zip";
  BackupTo "%DesktopReal%\Apps\", "%DesktopReal%\XnViewMP.zip",1,0,0,1,1,2,0;
EDIT2: Nevermind. Is it normal that each line of the script will normally try to run one after another quickly? For example:

Code: Select all

	BackupTo $Archive_Path, "<xypath>\$Name_Pattern",1,0,0,1,1,2,0;
	//[on_collision],[preserve_dates],[create_log],[pop_stats],[skip_junctions],[verify],[show_progress]
	Wait 1000;
	Delete 1, 0, "<xypath>\$Name_Pattern";
The Delete command here will try to run even before the BackutpTo command have not finished. As a result, I always get BackupTo/Moveto/Related Command to fail because the file gets deleted before it any of the copy type function finish. I had to add a Wait command here so that it won't happen.
Last edited by Enternal on 20 Nov 2013 23:32, edited 3 times in total.

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by LittleBiG »

here is compressing process:
Attachments
TodayIssue8.gif
TodayIssue8.gif (1.04 MiB) Viewed 2527 times

admin
Site Admin
Posts: 64836
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by admin »

Enternal wrote:EDIT2: Nevermind. Is it normal that each line of the script will normally try to run one after another quickly? For example:

Code: Select all

	BackupTo $Archive_Path, "<xypath>\$Name_Pattern",1,0,0,1,1,2,0;
	//[on_collision],[preserve_dates],[create_log],[pop_stats],[skip_junctions],[verify],[show_progress]
	Wait 1000;
	Delete 1, 0, "<xypath>\$Name_Pattern";
The Delete command here will try to run even before the BackutpTo command have not finished. As a result, I always get BackupTo/Moveto/Related Command to fail because the file gets deleted before it any of the copy type function finish. I had to add a Wait command here so that it won't happen.
Probably because of background processing. This will help:

Code: Select all

    + Scripting commands enhanced:
      - setting, settingp
        New named argument "backgroundfileops"
          0 = Disable background processing of file operations
          1 = Enable background processing of file operations
        Example:
          ::setting "backgroundfileops", 1;

admin
Site Admin
Posts: 64836
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by admin »

ZipFolder technology is not perfect. One day I will write my own zipping code.

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by Enternal »

Ah awesome! Thanks!

I do have background operations on but not for the delete operation so:

Code: Select all

Setting "BackgroundedFileOps", 31;
should solve all my problems. :biggrin:

Question though, in the manual:
1 [x] Backup (currently unused; has yet to be coded)
What do you mean by this?
admin wrote:ZipFolder technology is not perfect. One day I will write my own zipping code.
Hehe. We all look forward to that one day. Your own custom contro... I mean zip code (not to be confused with the US stats Zip Codes).

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by Enternal »

Aaargh. This is my code that I like to use to backup my Data folder:

Code: Select all

	Setting "BackgroundFileOps", 1;
	Setting "BackgroundedFileOps", 31;
	MoveTo "<xypath>", "<xydata>\Thumbnails\";
	$Tab_Ini = FormatList(FolderReport("files","r",<xydata>,"r",,"|"),f,"|",*tab*.ini);
	If $Tab_Ini != "" {
		Delete 1, 0, "$Tab_Ini";
	}
	Zip_Add("<xypath>\Data.zip", "<xydata>");
	//Wait 2500;
	MoveTo "<xydata>", "<xypath>\Thumbnails\";

	$Archive_Path = "\\CrimsonRose\Public\Documents\XYplorer\Backup";
	$Date = Property("Write", "<xypath>\Data.zip");
	$Date = FormatDate("$Date", "mm-dd-yyyy");
	$Hash = Hash("crc32", "<xypath>\Data.zip", "1");
	$Name_Pattern = "Data_%ComputerName%_[$Date]_[$Hash].zip";
	RenameItem($Name_Pattern, "<xypath>\Data.zip");
	BackupTo $Archive_Path, "<xypath>\$Name_Pattern",1,0,0,1,1,2,0;
	//[on_collision],[preserve_dates],[create_log],[pop_stats],[skip_junctions],[verify],[show_progress]
	//Wait 2500;
	Delete 1, 0, "<xypath>\$Name_Pattern";
	AttrStamp("ar", "2", "$Archive_Path\Data_%ComputerName%_[$Date]_[$Hash].rar");
I like the move the Thumbnails folders out of the way because sometimes it's over 250 MB. Don't need it to be backed up.

So it backups the file fine (although once in a while, it pops up a renaming error since the file is still being zipped) yet in the Background Jobs log, it always show something like:
Completed 3mins ago after 1 sec (Canceled or Failed)
Basically it said that it failed but it did not. I think that's a bug or something.

admin
Site Admin
Posts: 64836
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by admin »

Does it also happen when you step through it?

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by Enternal »

It works perfectly when I step through it. It's pretty much like adding a "Wait" at every other line isn't it? When you step through it, it "Waits" until it gets feedback from you to continue. In the case that you run it straight, it will "try to do everything as fast as it can" in which it then fails. It seems that even though background ops is on with all settings enabled, it still wants to delete the file a bit too early. Without backgroundops, it delete files waay to early so backupto completely failed (no final file in backup location) but with backgroundops, it's able to copy it successfuly but the report shows that it failed. Probably checksum errors or something?

admin
Site Admin
Posts: 64836
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by admin »

Well, actually you should do this:

Code: Select all

Setting "BackgroundFileOps", 0;
= Turn them OFF, because they run async, creating the problems you see.

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: ZIP Support (so I can finally retire "PowerDersk Pro")

Post by Enternal »

Ah! I did not understand background ops so now that I read it again, I understand how it works. Anyway, that script now works perfectly! Rename does not rename the file either until zip_add() finish. That's awesome! Thank you!

Post Reply