Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd March 2017, 10:39
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 130
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Is there any permission or header file needed while read a server file from client

Hi,
I am new to ERP Ln.

I want to read a server file from client. but while open a file by using seq.open,

I got a error as "Error in file opening"...

Here i attach my script and plz anybody assist me....

|Checking where the customer ASCHI file is available or not in the server path
fd = dir.open(file.path)
if fd < 0 then
message("file path not available in the server")
|mess("zmadms0046", 1, fpath)
|* Directory Handling Errors: %1$s
exit(1)
endif

fname = dir.entry(fd, TFILE, TFILE , size, STAT_READABLE)
message("file %s",fname) |Find the name of the file

fp = seq.open(fname, "r")
if fp < 0 then
message("%d error in file opening",fp)
|mess("zmadms0036", 1, fname)
|* File Opening Error: %1$s
e = seq.close(fp)
exit(1)
|continue
else
|* file found - do.something......
message("file found")
e = seq.close(fp)
endif


}
Reply With Quote
  #2  
Old 22nd March 2017, 10:52
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 573
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hi,

please change one line from
Code:
if fp < 0 then
to
Code:
if fp < 1 then
Regards,
Juergen
Reply With Quote
Sponsored Links
  #3  
Old 22nd March 2017, 12:42
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 130
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Thanks for ur reply...

Actually, the seq.open returns -2 even the specified file is available in the proper server path...

Normally seq.open returns positive value. So why it is return -2 in my case...
Reply With Quote
  #4  
Old 22nd March 2017, 13:35
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,935
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Does dir.entry return just a file name or a filename and path? I am thinking you might need to add the path infront of the file name.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 23rd March 2017, 06:01
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 51
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by pralash View Post
fname = dir.entry(fd, TFILE, TFILE , size, STAT_READABLE)
The second and fourth arguments are reference variables.
So, a variable needs to be sent and the value of the variable needs to be checked for TFILE/STAT_READABLE+ (means permission can be greater than read).
Checking these values in debug window will give more details.

Next check if you have sufficient size declared for fname.

Regards,
Reply With Quote
  #6  
Old 23rd March 2017, 09:11
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 445
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
What is the value of fname?


The filename in seq.open(filename,openmode) has to be the complete File Name in the server and also the User should have write permissions in the specific directory..

Something like

seq.open("d:\Infor\LN\bse\tmp\print_file_23rd_March.csv","w")
Reply With Quote
  #7  
Old 23rd March 2017, 12:59
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 130
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Thank u so much for your reply...

Actually, i have missed the actual file path while using the seq.open function. So I could not read the information of the file...

But now i open the file by mentioned the full path... It's working fine

Regards
Pralash
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Browse Server ArokLair Code & Utilities 4 23rd April 2015 06:21
Problem with bdpost via Session ttaad4227m000 (Create Table from Sequential Dump) BOBBYLYON Tools Administration & Installation 2 16th October 2009 22:56
read file form live server abby13 Tools Development 9 6th February 2009 13:47
read local file and generate report jmathew Tools Development 19 16th October 2006 08:50
seq.open berthe Miscellaneous 4 12th May 2005 11:20


All times are GMT +2. The time now is 03:10.


©2001-2017 - Baanboard.com - Baanforums.com