File existence

Hi all, I need to check a directory for the presence of a file. I tried using the system table FILE like that: RcFile : Record 2000000022; REPEAT RcFile.RESET; RcFile.SETFILTER(Path,MyFilePath); RcFile.SETFILTER(“Is a file”,‘1’); RcFile.SETFILTER(Size,’<>%1’,0); UNTIL RcFile.COUNT <> 0; but the loop hangs indefinitely. I’ve been told that the system table FILE remains ‘dirty’ and thus doesn’t work properly… Does anybody knows a working method ?? thanks

Hi

quote:


Originally posted by andre_jack
… RcFile : Record 2000000022; REPEAT RcFile.RESET; RcFile.SETFILTER(Path,MyFilePath); RcFile.SETFILTER(“Is a file”,‘1’); RcFile.SETFILTER(Size,‘<>%1’,0); UNTIL RcFile.COUNT <> 0; …


You can use also this IF FILE.EXISTS(YourFullPath) THEN BEGIN; In your example I would try this: i:= false; REPEAT RcFile.RESET; RcFile.SETFILTER(Path,MyFilePath); RcFile.SETFILTER("Is a file",'1'); RcFile.SETFILTER(Size,'<>%1',0); If Rcfile.Find('-') then i:= true; UNTIL i = True; PS But this is still a loop. Perhaps it would be better to use OnTimer. bye André

I remember some Problems with the File-Table in earlier Version of Navision. The actualisation does not work correct. There are several threads about it. Is this Problem in 3.6 still alive? Greetings, Frank

Please read this post. It will answer all your questions. http://www.navision.net/forum/topic.asp?TOPIC_ID=5965

Thanks a lot, Emiel

btw why not? REPEAT RcFile.SETRANGE(path, 'c:\'); RcFile.FIND('-'); RcFile.SETFILTER(Path,MyFilePath); RcFile.SETFILTER("Is a file",'1'); RcFile.SETFILTER(Size,'<>%1',0); UNTIL Rcfile.Find('-'); But then again, like Andre told you…

quote:


You can use also this IF FILE.EXISTS(YourFullPath) THEN BEGIN