WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Directory (Folder) copy
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1246230379

Message started by Maka on Jun 29th, 2009 at 1:06am

Title: Directory (Folder) copy
Post by Maka on 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.


Title: Re: Directory (Folder) copy
Post by Gert on 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 ...
[/code]

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.