WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
UnRAR (Read 6199 times)
RJG
YaBB Newbies
*
Offline



Posts: 15
UnRAR
Mar 10th, 2011 at 1:46am
 
I can't seem to figure this out,

I have WD monitoring a folder for new split rar archives, when found, unrars archive to another location.

The problem:

How do I get WD to wait for all the archive pieces to be transferred (can take hours) before starting the unrar plugin?

Thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: UnRAR
Reply #1 - Mar 10th, 2011 at 8:23am
 
Those split rars have R00 - R99 extensions, I believe? And there also is a RAR file, the main file?

Is there any guaranteed order of those files? For example, the RAR is always created last?
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
RJG
YaBB Newbies
*
Offline



Posts: 15
Re: UnRAR
Reply #2 - Mar 11th, 2011 at 12:05am
 
Gert wrote on Mar 10th, 2011 at 8:23am:
Those split rars have R00 - R99 extensions, I believe? And there also is a RAR file, the main file?

Is there any guaranteed order of those files? For example, the RAR is always created last?


Yes
to your first question and
no
to your 2nd question (no download order)
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: UnRAR
Reply #3 - Mar 11th, 2011 at 8:03am
 
It will probably be possible to do this with a batch script.

Will all files be split archives or will there also be plain-old RAR files?

The way I envision this is that you let WD monitor for RAR files (not  .R00, .R01...). The script then goes into a loop, sleeping 10 seconds on each iteration. Every loop it does a directory listing to look for "other .Rxx files" with the same base name. It checks and records the file-size of each of them. When sizes do not change anymore, it is ready to continue to unrar.

Do you see any issues with the above?

I will give it some more thought over the weekend and see if I can implement something for you.
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
RJG
YaBB Newbies
*
Offline



Posts: 15
Re: UnRAR
Reply #4 - Mar 12th, 2011 at 12:55am
 
Sounds like a great game plan, thanks for all your help Gert.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: UnRAR
Reply #5 - Mar 13th, 2011 at 10:33am
 
I tried to do this completely using bat scripting, but that was too hard.

I made a little command-line program for you, called Twins.exe, attached to this post.

Code:
Twins 1.0
(c)2011, GdP Software
Wait until a file and files with other extensions are ready.
Twins [-i99] [-n99] [-q] filename
        -i99: seconds between checks
        -n99: how often no changes found before checking stops.
        -q: don't be verbose
 


Unzip the attachment and place Twins.exe in C:\Bin
Create a new Unrar task, let it monitor for RAR files only (not for .R01, .R02 etc). Assuming the task is called "MyUnrar":
* Select "Tools -> Explore Task Directory" (this opens Windows Explorer in the directory with WD settings and tasks)
* Navigate to the subdirectory MyUnrar (the name of your task)
* Open the file WD.bat you find in that directory.

Scroll to line 33, where you will find
Code:
"%UNRAR%" x %OPTIONS% -y "%WD_FILE%" "%TARGET%" 


That is the line that actually calls unrar.exe to unrar the file. Just before that line you need to call Twins.exe to wait for all files, so type on line 32 (the line BEFORE the unrar):
Code:
"C:\Bin\Twins.exe" "%WD_FILE%" 



You may need to experiment a bit with its switches (-i99 and -n99):
-i99 (which defaults to 10) is the number of seconds the program sleeps between checks.
-n99 (defaults to 5) is the number of times the program must see no changes before it considers all files complete

The program checks for changed timestamps and file sizes (and for new / removed files). If you like it, please consider giving a donation to the Alzheimer's Foundation ( http://blog-en.gdpsoftware.com/2011/02/world-without-alzheimers-disease.html ) or your favorite charity.
Back to top
 

Twins.zip (105 KB | )

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
RJG
YaBB Newbies
*
Offline



Posts: 15
Re: UnRAR
Reply #6 - Mar 16th, 2011 at 12:57am
 
Gert,
  Thank you so much for your work, I have tested it (once) and it seems to work, I will follow up after more testing!

Back to top
 
 
IP Logged
 
patrick
YaBB Newbies
*
Offline



Posts: 3
Re: UnRAR
Reply #7 - Mar 26th, 2011 at 10:56pm
 
what option should i use on the "wait for files.." tab?
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1