Problem: Writing and reading a textfile on a remote agent. Apparently SilkTest writes these on the controller's harddrive. I tried to avoid this problem by calling a function from the kernel32.dll.
Basically this solution works nice except for its speed.
So I would like to know if anyone knows a faster read&write solution. Thanks.
Most of the specific file-orientated functions (e.g. FileOpen, FileWriteLine, FileReadLine, FileReadValue, etc.) do only work on the host machine. You can use SYS_GetFileContents to read from a file on the target machine, but I don't know of any way within silktest of writing to a file on the target machine. In order to get round this problem, I have always made my scripts use files on a fileserver - makes them more portable across machines for one thing.
Unfortunately these standard functions mentioned by Vince really just work on the host machine.
SYS_GetFileContents does its job nicely though AND fast, but writing via the kernel32.dll is STILL slow. I could not fine a workaround for this, yet. Though reading is faster now I still hope there might be someone who knows a fast way to write into a via the remote agent.
The current situation does not allow me to collect the files on a common machine and I am not in the position to change anything about this.
Don't blame the QA testers!
[This message has been edited by KlausK (edited 07-12-2001).]
My appologies. I knew I had a test that was writing to a file from about two years ago, and it was doing it on a remote machine... Solaris even. However, what I didn't recall was that it was a test exercising file writing functionality within the AUT rather than Silk actually writing to the file.
I know this is not the most glamorous solution but I shared out the drive and then read/wrote to the drive from the host machine. I used this to modify batch files on the remote machine the I could use SYS_Execute to run the file.