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
Create a small dummy file with same name as source (Read 831 times)
presley
YaBB Newbies
*
Offline



Posts: 10
Create a small dummy file with same name as source
Jul 28th, 2015 at 12:35am
 
What I would like to do is:
- monitor a directory for new files
- when a new file is detected, create a new file with the same name (does not need meaningful content, could have a single character in it.)
- put that file somewhere else
- delete original

I am dealing with large video files and I need to get the filename to place in a different directory.  I can do that today, but need to send the entire original ( like 400MB each) to the other location for the other process to get the filename.  I'd like to not have to transfer that large file when all I need to pass on is a small file with the same name.  Is that possible?

Thanks!

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



Posts: 2225
The Netherlands
Re: Create a small dummy file with same name as source
Reply #1 - Jul 28th, 2015 at 10:17am
 
Hello Jim,

Use the run-a-batch file task and let it trigger the following script:
Code:
echo hello > "C:\SomeOtherDir\%WD_FILE_N%"
DEL "%WD_FILE%"
 



%WD_FILE_N% is a variable that is replaced by the detected file name, %WD_FILE% with the full name including the path. See http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html
Back to top
« Last Edit: Jul 30th, 2015 at 8:07am by Gert »  

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