pjohns
7th August 2003, 18:21
This is the continuation of a thread that was started in the tools admin forum.
Please see thread http://www.baanboard.com/baanboard/showthread.php?s=&threadid=12500
mark_h
7th August 2003, 19:02
It looks like you are trying to read a file from the c drive rather than on the server. Try using
seq.open.local.
On a side note I always copy local files to my server and then user them. See below for a sample. I almost always copy the file up to the server, process, then copy back the output. I only use seq.open.local to make sure the file is present.
Mark
function domain tcbool open_file()
{
long rc
| Create temporary file to copy the PC file to
temp.file = creat.tmp.file$(bse.tmp.dir$())
temp.file = strip$(temp.file)
| Open PC file to make sure it exists.
inputfile = seq.open.local(input.file,"r",0)
if(inputfile<0) then
file_err(inputfile)
return(true)
endif
seq.close.local(inputfile)
rc = client2server(input.file,temp.file,0)
| Open Server file for processing.
inputfile = seq.open(temp.file,"r")
if(inputfile<0) then
file_err(inputfile)
return(true)
endif
return(false)
}
NvanBeest
8th August 2003, 10:11
On a side note I always copy local files to my server and then user them.How do you user a file??? :D
lakoon
8th August 2003, 12:08
good morning pjohns,
sorry, i'm late ...
but I checked my script an the statements on my environment.
put the following lines into the check.input section
check.input:
file_name = strip$(client.filename(rpos(client.filename, "\")+1; len(strip$(client.filename)) -rpos(client.filename, "\")+2))
dll.io = tcmcs.dllftp.c2s(client.filename, "${BSE}/tmp/" & file_name)
The extraction of the filename is a little bit tricky, as the system generates to \\ .
The code in the dll works fine..
Try once more.
pjohns
8th August 2003, 13:44
Hello Lakoon,
I tried your suggestion (please see attached)
The script compiled okay but when I run my session it says that it cannot find the file entered in the 'in.file' formfield.
Any more ideas:confused:
Regards
PJ
lakoon
8th August 2003, 14:29
yes, I think
Insert the red part of the command line
file_name = strip$(in.file(rpos(in.file, "\")+1;len(strip$(in.file)) - rpos(in.file, "")+2 ))
Please debug the the statement, to see what file_name you get.
lakoon
8th August 2003, 14:35
oh, overlooked something...
your variable in.file contains the path and filename of the client.
after we have called the dll to transfer to the server
you have to set in.file to the server path / filename
like:
in.file = "${BSE}/tmp/" & file_name
put this instead of:
pjohns
8th August 2003, 18:05
Hello Lakoon,
It worked!!
Thanks for all you help.
Till next time!
Have a good weekend.
Regards
PJ