We are loading 2.4 million of data for every 5 minutes for one of our real time application. we need to generate files in ( A folder) and need to transfer the files to (B folder), Everthing is running fine , But once or twice in a day job is failing to move files from (Folder A to Folder B) after next run ( after 5 min)job is running fine Below is the error .
When we have check with network team they say everything is fine on network side. Really don`t know what is the root cause.
Sometimes this may happen when the files in folders A or B are open when SAP DS trying to move the files. Please make sure that no one is opening the files when the job is running.
I see this happen a lot more than I like. DS will start the next process on a file without it being closed, or the task being completed.
I attribute this to the file system being too busy, and usually this happens when looping through a lot of files but it can happen any time. (loops increase the odds)
If you use python at all …
def is_open(filename):
from ctypes import cdll
_sopen = cdll.msvcrt._sopen
_close = cdll.msvcrt._close
_SH_DENYRW = 0x10
import os
if not os.access(filename, os.F_OK):
return False # file doesn't exist
h = _sopen(filename, 0, _SH_DENYRW, 0)
if h == 3:
_close(h)
return False # file is not opened by anyone else
return True # file is already open
I’ve gotten to the point where I have to put sleep(5000) functions before these moves. I have not updated everything with the Python is_open check yet.