lakoon
23rd June 2005, 17:05
Hello

I browsed to a lot of threads, but did not find an answer.

I try to open a local file with the following command:

fp = seq.open.local("d:\temp\hostsend.dat", "a", false)

The return value for fp is 0, no file created or existing file opened.

If I do

ret = seq.open.local("d:\temp\hostsend.dat", "w", false)

The return value for fp is any number greater 0, the file is opened/overwritten.

Why is the function with the file mode "a" not working. Do I miss something?

Just happy for any sugestions.

/lakoon

frigyesg
23rd June 2005, 18:41
May be it´s a problem from the bw client, but I´ve only used the "r" option and it worked.

NPRao
24th June 2005, 04:50
Lakoon,

Here is a test script and it works for me -

#pragma used dll ottdllbw
function main()
{
long fp

fp = seq.open.local("C:\Test.txt", "a", false)
if fp >= 0 then
e = seq.write.local("This is a test program", 80, fp)
seq.close.local(fp)
endif
}

Also refer to the thread - Check Client Directory (http://www.baanboard.com/baanboard/showthread.php?t=7127&highlight=183)
You can check the client directory permissions before you write to the path.
Alternatively, you can also write the file on the server then use server2client() to copy to the local disk and trace the issue.

Rita Kotecha
24th June 2005, 09:18
Hi

You can use seq.open as follows :

fname = sprintf$("Filename")
fd.in = seq.open(fname, "r")
if fd.in >= 1 then
err.fd = seq.open(errname, "a")

lakoon
24th June 2005, 13:52
Hello NPRao

Any restrictions to the version? I try to use it with Baan IV c4!

/lakoon

NPRao
24th June 2005, 19:38
I can only think of the dependency on the library ottdllbw and porting set.