Lotus Notes: Create a text file -
i trying create text file in lotus notes running through agents. agent ran text file not created in path specified in lotus script.
this lotus script code:
option public sub initialize msgbox " agent accessuserlist" on error goto handleerror dim session new notessession dim mystream notesstream dim thedate string, filename string thedate=format(now(),"mmdd") filename = "c:"+"\red"+"\color"+thedate+".txt" msgbox filename set mystream = session.createstream() msgbox "mystream2" call mystream.open(filename, "ascii") msgbox "mystream3" call mystream.truncate() msgbox "entered view" closefile: call mystream.close() msgbox "closed" exit sub handleerror: msgbox "error - " & error &" @ line number " & erl exit sub end sub
i have scheduled 5 min check whether creates new file in specified folder
and privileges while scheduling used both second , third allow restricted operations allow restricted operations full administrator rights
but still shows folder empty folder time changed when gets scheduled.
to test scheduled agent run locally in server. error same text file not created.
agent log not having errors.
i have checked in logs , there no errors. can tell mistake in above code , why file not getting created when agent executes correctly.
notesstream
doesn't work you want create empty file.
call mystream.close()
deletes created file if it's empty @ point.
use traditional freefile()/open/close instead:
sub initialize on error goto handleerror dim thedate string dim filename string dim filenum integer thedate = format(now(),"mmdd") filename = "c:\red\color" + thedate + ".txt" filenum = freefile open filename output filenum close filenum finally: exit sub handleerror: msgbox "error - " & error &" @ line number " & erl resume end sub
Comments
Post a Comment