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
AMC script not waiting for files to finish copying
Re: AMC script not waiting for files to finish copying
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.
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
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
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.
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
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.