vb.net - Process cannot access it is being used by another process -
i got solution 3 separated windows services. 1 services download files, second taking files , third 1 loading db. during downlading files, second process starting play during still downloading, or third process wants load file still parsing. heard mutex resolution in case not sure how in situation use other processes waits on files untill "free". below i'll present code:
downlading process part of code file download doing: (in case each file downloading specific location folder)
each item in remotefiles try session.getfiles(item, downloadfolder, true, transferoptions).check() catch ex exception end try next
parsing win service process part of code parsing downloaded files:
dim columnfound boolean = false using myreader new fileio.textfieldparser(filetobeparsedpath) dim currentrecord string() ' array hold each line of data myreader .textfieldtype = fileio.fieldtype.delimited .delimiters = new string() {","} .hasfieldsenclosedinquotes = true end
after process each file migrated parsedfolder. data saved in files .dat extension. , files used loader engine.
how can "lock on file" instance files during download process prevent parser take them under parsing process , wait? can make centralized place file status saved, parser after take existing files list , when going open , parse them check , wait untill free?? please advice/code.
edited:
•ftp 2 files watch one. example send files important.txt , important.finish. watch finish file process txt.
•ftp 1 file rename when done. example send important.wait , have sender rename important.txt when finished.
Comments
Post a Comment