Page 1 of 1
AMC script not waiting for files to finish copying
Posted: 21 Jan 2017, 00:53
by Diehard
I have the amc script called on a remote PC when a new video file has been detected in a folder.
The transfer is over a local network to a shared folder so it takes anywhere from 1-10 minutes depending on the file size.
Is there anyway for the amc script to check or wait for the file to completely finish.
Windows 10 x64
Re: AMC script not waiting for files to finish copying
Posted: 21 Jan 2017, 05:40
by rednoah
No. The FileBot must not be called on files that are being written. If you do, then behaviour is entirely unspecified and platform-dependent.
I would think that Windows would stop FileBot from moving any files with a "This file is used by another process" error.
Re: AMC script not waiting for files to finish copying
Posted: 21 Jan 2017, 20:54
by Diehard
I know for linux you can check if a file is in use and then wait for it to finish. Windows just doesn't want to/care, what windows should do is write network transfers to a temp file then rename once finished. I didn't think so but doesn't hurt to ask thanks again @rednoah
Re: AMC script not waiting for files to finish copying
Posted: 22 Jan 2017, 12:00
by rednoah
I don't think you can do that on any OS, unless all processes involved explicitly use read-write locks.
You can easily select only files that haven't changed for x minutes using the find command and then pass those files onto FileBot if you're on Linux. Not sure if PowerShell has any equivalent for find -exec or xargs though.
Re: AMC script not waiting for files to finish copying
Posted: 23 Jan 2017, 01:11
by Diehard
I have not found anything useful to achieve this but rather a work around.. I am using a timeout command at the beginning of my .bat script which delays for a few minutes then runs Filebot and moves to desired locations. This will not work for every size of file but it's the best solution I have found that is painless.