Navision filecache?

Hi, I need to monitor changes in a small textfile on the harddisk. This textfile is editet and rewriten by an external service program every time some event is happening. I do this by continuosly opening, reading and closing the file, every 200 ms. This also works fine indeed. BUT (there always is a BUT) when the navision client is run thru a Citrix Session and the textfile I need to read is placed on the harddisk of the local computer it doesn’t work. The file is read OK the first time but after that, I can’t see any changes althought I know that the file does indeed change. It seems like navision has cached the little textfile (about 20-100 bytes) and doesn’t want to update it. Even if I erase the file every time I read it the content of the file, the next time it appears, hasn’t changed. And I know the next time the file shows up it has changed. And I can see that navision has discovered that the file is erased from time to time… In my desperation I tried to open and read a deferent file in between I open the file in question - just to see if this would update the cahce - but it is the same story. I also tried open and reading the file thru a dataport but again its the same. Then you say “Can’t it just be a Citrix File Cache problem?”. Is was also my first idea but and old pascal-executable doing excacly the the same from a dos-prompt works just fine! It has no problems with the Citrix File Cache (if such a thing exists). Does anyone know how to solve this problem? I don’t know anything about how navision is handling files and access to those. My guess after this expirience is that it uses the File Virtual Table as a cache and saves the content in the BLOB-field. And because the file is that small it doesn’t seem to be updatet very often. Only why does the problem only apear through the Citrix Session? It is no secret that a Citrix Connection does not offer the fastest of connections to local devices… - Allan Pedersen

Try setting another filter on Your file-variable and do a "IF FIND(’-’) between the times You try to read the folder Your’e interested in. You need to redirect the virtual file variable and do a FIND in another folder to get it reset. There has been examples of code for this earlier on the forum //Lars

I do not use the File Virtual Table to acces the file. I know the name of the file and do something like File.open(path+filename); File.read(Text); File.close; I am aware of that you must change the filter in order to be sure to have the latest info in this table. This is also the reson why I think that i migth be a problem with navision’s file handling if it does indeed use this table for file cache. - Allan

Hi, there is another point of view: the Navision client is runnig on the terminal server, but the file is on the local machine. in between there is the network connecion. maybe the setting of the connection makes the caching of the file. The file is changed on local drive, but that must by propagated over the network to the TS system, and it takes time (seconds?). Try to put the file not to the local HD but to servers drive (mapped or URL).

Did you search all the forums? I made a post some time ago with the solution! http://www.navision.net/forum/topic.asp?TOPIC_ID=5965 good luck!

quote:


Originally posted by jkiss
Hi, there is another point of view: the Navision client is runnig on the terminal server, but the file is on the local machine. in between there is the network connecion. maybe the setting of the connection makes the caching of the file. The file is changed on local drive, but that must by propagated over the network to the TS system, and it takes time (seconds?). Try to put the file not to the local HD but to servers drive (mapped or URL).


As explained in the first posting an old pascal executable is able to do the job - at the same rate (every 200 ms). This means that something i different (or just slower) in navision and that its not likely to be the network or citrix connection cache making trouble. Actually if I continuosly let windows open and close the file (e.g. in Notepad) then I do will discover the changes in the file. Also in navision!!! It seems like navision can’t manage the file but with a little external help it works fine. But why??? And how can I solve this without using “external help”. It doesn’t seem right to me. - Allan

quote:


Originally posted by eromein
Did you search all the forums? I made a post some time ago with the solution! http://www.navision.net/forum/topic.asp?TOPIC_ID=5965 good luck!


Since I do know the path and the name of the file I have no need to “look it up” in the File Table (as described earlier). And thats what you du in your example. I am aware of that problem since I made some similar solutions myself. In this case I can just call File.Open() etc. direcly. But perhaps a lookup in the directory could indeed “update” the content of the file. I think I’ll try that as I feel that I’ve tried anything else. - Allan

Allan, did you try CLEAR(File); before open ist again? What is the result of File.Getstamp after the file is written again? Regards Walter

quote:


Originally posted by walter@kirz
Allan, did you try CLEAR(File); before open ist again? What is the result of File.Getstamp after the file is written again? Regards Walter


Since File is a local variable in a funktion run for each time the file is read the I don’t think that Clear(File) will help (the variable is already fresh and new for every time). But I’ll check it anyway and the stamp too. -Allan