fListFile fDelete fFileExists issue WD18

Startbeitrag von Malc am 16.03.2015 15:25

Hi Guys

OK, got a little issue with a service I've written that watches a folder for inbound text files and imports them into a database.

I use fListFile to get a string from which I build an array of files to process
I use fOpen with foReadWrite + foReadLock + foWriteLock so that theoretically, no other program can access it while I'm reading the data.

When the data is successfully processed, I fClose then use fDelete to temove it.

This code has been running since about WD12

I now have an issue where I am importing 2 copies of the file into the database.

Adding some extra debug code with additional fListFile after processing, the file is initially correctly gone ( and fFileExist is false). However milliseconds later another fListFile finds it again!

I have tried modifying the code to rename and delete the renamed file, which again reports success, but the file(s) still mysteriously appear.

Anyone else have similar issues?

I am about to try deleting via ExeRun or API and see what happens.
Also, I might put a pause in the looping, but would like to avoid this as performance is a factor.




OK, tried ExeRun and fFileExist to check deletion. Still re-appears.

I'm guessing something has changed on the server re caching or file indexing or something which is flushing the file back to disk

Next step is a pause in the loop :(

von Malc - am 16.03.2015 16:39
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.