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
Directory (Folder) copy (Read 2107 times)
Maka
YaBB Newbies
*
Offline



Posts: 1
Directory (Folder) copy
Jun 29th, 2009 at 1:06am
 
Hi, we have a digital asset management system that creates a directory for each new job on a server. Specifically named empty directories are automatically created within the new job directory.
I would like to copy the newly created directory to another location to be populated. (and then in return update the newly populated folders/files back to the server)
Is there a way to have watchDirectory copy the newly created directory and all of the empty directories contained within to another location?
WatchDirectory currently appears to only copy directories that contain something. Empty ones are ignored.

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



Posts: 2225
The Netherlands
Re: Directory (Folder) copy
Reply #1 - Jun 29th, 2009 at 9:24am
 
Hello Maka,

The "auto copy" task doesn't react on new directories, only on files (and then it can recreate the directories as needed).

You can implement this functionality yourself using the "run a bat file" task ( http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html ), something like this:

Code:
SET TARGETDIR=\\Server\share\SomeDir
rem if we are called because a new directory is detected
rem create the same directory below the target
IF "%WD_REASON%" EQU "DIRNEW" (
   MD "%TARGETDIR%\%WD_FILE_N%"
  GOTO :EOF
)
... other code, for example to copy detected files ...
 



Gert
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
 
Page Index Toggle Pages: 1