I have an LSS agent that currently runs once a day and pulls data from a text file and imports it into a view.
I have copied this agent, made some adjustments to pull data and store different fields from a different text file in the same directory as the first.
The copied agent will not work as it will not “see” the text file, meanwhile, I cannot find any difference between the original and the copied one other than the fields that I changed to pull data to.
Also, I created from scratch, another agent that would simply open a text file, store the word “TEST” and close it. This agent also will not “see” the text file stored locally on the domino server. It will work however if I use a Windows shared directory path instead of the local path.
How can one agent be able to read a file locally on the Windows file system outside of the Domino directory, while the other two cannot? What am I missing?
Is the file in the Domino data directory? Is the agent signed by the same person? You don’t provide any of your code so it’s hard to guess what the problem might be.
One file is outside of Domino in C:\example\sub\Data\filename.txt
The other is inside the Domino HTML dir (c:\lotus\domino\data\domino\html\example\sub\filename.txt)
Sub Initialize()
Dim session As NotesSession
Set session = New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
Dim stream As NotesStream
Set stream = session.CreateStream
Dim filename As String
filename = "c:\example\sub\Data\filename.txt"
If stream.Open(filename, "Binary") then
Call stream.Truncate()
Call stream.Writetext("Hello World", EOL_CRLF)
Call stream.Close()
End if
End Sub
It makes no sense to me that I inherit one agent that works with files outside of the Domino directory, but two others that do not, regardless where the location of the file is.
There are two places you need to check to allow agents to read/write to the file system since that is a potentially dangerous operation. First, the agent signer must have authorized to “Run unrestricted methods and operations” on the server in question. Second, the agent security properties must be set to at least “Allow restricted operations”. The second part may be what’s tripping you up with the new and copied agents.