learner
2nd March 2010, 21:53
Subject should be read as "Read File from network path"

Hi,

I have a text file which resides on windows network eg ( \\winserver\somefolder\file.txt ), my baan user has acess to this path because of his windows\network authentication.

Now this file actually contains some sensative data and i would like to import data from this file into a baan table in my Process session.

i was able to open n read file using seq.open function when the file resides on unix i.e. my baan server , but how do i read a file which resides on a windows network folder, is there a baan function to do this ...????


Note : I would not like to copy the file to local drive to read it because of data sensativity.. so server to client function is ruled out.

Any suggestions on function name on how to read file available on win network in shared dir ?

Regards

Learner

mark_h
2nd March 2010, 23:51
Have you looked at the seq.open.local command? Is there a mapped directory? No spaces in anything to cause a problem? That should work, but I have always used the client2server command to do this - never could get the reads to come out correct on the local servers or drives.

mark_h
2nd March 2010, 23:52
OOPs this also includes seq.read.local and other commands like that, you might want to try searching on those.

george7a
3rd March 2010, 09:34
I personally has experienced some bugs in the seq.open.local function (and the related ones) on some baan systems. So be careful and make sure you check the ottbwdll for the exact documentation for these functions.

Although you have ruled out client2server, you might want to check it again, it is more robust! You can copy the sensitive file to the server, read it and then delete it!

BaanInOhio
3rd March 2010, 16:40
+1 on the client2server solution. I have used the "seq_local" calls and they are possible but a bit difficult to program. First, the reads are done from the file for the length of the buffer (specified in the 2nd argument of the read statement), including line termination characters. Therefore, you should read from the file into a big buffer, then scan the buffer for termination characters (cr/lf) for placing the data into lines as they appear in the client file between the termination characters. The next buffer is added to the rest of the previously read big buffer, then repeat the process for parsing.

Much easier to copy the file into a server location, read it, then immediately delete it.

You can call 'file.chmod' immediately after the copy to Unix to remove all but 'user' for more security.

file.chmod(file.name, S_IRWXU) | Set security for user (only) to manage.

learner
3rd March 2010, 22:25
Thanks a lot for the input, those were really helpful. Finally i am using client2server with chmod function. :D

seq.open.local was a little time consuming , and because of the current delivery deadlines :( i went with easier method which has been suggested.


Regards

Learner