Access text file from server

Hi I need to access a text file which is residing on the server. How can I do this?

I have a code which accesses it correctly from my local machine

Open “d:\thenames.txt” For Input As fileNum%

How can I change the above code to access the file from server?

Subject: more info needed

Are you running the code on a local computer, with the file on the server, or running it on the server? If the first case, then you need some established pathway (network drive letter or such). If the second case, then it should work exactly the same way as on your local computer, so what’s the problem?

Subject: Access file from server

Hi,I have to run a scheduled agent on the server.

Open “d:\thenames.txt” For Input As fileNum%

I changed the above code to

Open “\server IP\notesdata\thenames.txt” For Input As fileNum%

but it does not work

Subject: no - that will not work

you need to get the LOCAL name of the file, not the network name. If you know where the file is then hard code that (Drive:\Foldername\filename. If it’s located somewhere inside the Domino server’s data folder, you can get that by calling the notesSession.GetEnvironmentString function, looking for Directory value.

Subject: scheduled agent

I know where the file is located on the server i.e. “\server IP\notesdata\thenames.txt”

The agent is scheduled and is suppose to run on the server twice a day.

Could u please explain how to use GetEnvironmentString in this context?

Subject: if you know where the file is on the server…

then code it exactly the same as you do for a local machine. Agent running on the server will behave exactly the same as agent running on your machine, interms of local disk.