Hi, I'm having a strange error with our NAS server. It's supposed to check for files in a particular directory, then read the files in. It seems to work for a period in time, then the NAS server stops seeing new files on the file server. I even forced a restart of the NAS every 10 minutes, but no success.
If I manually close the NAS server (it's a command prompt) and restart, it's starts working again.
Has anybody seen this problem?
Thanks !
0
Comments
You need to reset it before rereading. Otherwise it will not refresh the table contents from the filesystem.
Here's the code (scanFile is a file record). I was getting oddities with the .FIND('-') - doing two finds seemed to fix the problem -
SELECTLATESTVERSION();
scanFile.RESET();
scanFile.SETCURRENTKEY(Path, "Is a file", Name);
scanFile.SETRANGE(Path, iSubDir);
IF scanFile.FIND('-') THEN;
SELECTLATESTVERSION();
scanFile.RESET();
scanFile.SETCURRENTKEY(Path, "Is a file", Name);
scanFile.SETRANGE(Path, iSubDir);
scanFile.SETRANGE("Is a file", TRUE);
scanFile.SETFILTER(Name, iFileFilter);
IF scanFile.FIND('-') THEN REPEAT
oFoundList.Key := scanFile.Name;
IF oFoundList.INSERT() THEN;
UNTIL scanFile.NEXT() = 0;