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
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 12th March 2010, 18:27
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
Exclamation Browse a file on server (windows)

Hi !!

I'm looking for a statement, because i need to find a file on windows server to know if it exist or no, then i need to put a label (yes) in a layout in baan.

Sorry.. my english is so bad XD

Can someone help me !!!!
Reply With Quote
  #2  
Old 12th March 2010, 18:58
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
I found a statemet (server2client) but i don't know if i can use it to look for a file (only i just want to know if the file exist or not on the server)
Reply With Quote
  #3  
Old 12th March 2010, 19:43
steveauckly steveauckly is offline
Senior Member
 
Join Date: Sep 2001
Location: Kansas City, MO, USA
Posts: 168
steveauckly is on a distinguished road
Baan: Baan IVc4 SP26 - DB: Oracle 10g - OS: Windows XP Pro
try this

You could try:
Code:
file.id = seq.open("filepath\filename","r")
if file.id = -2 then
   |file does not exist
else
   seq.close(file.id)
endif
Reply With Quote
Sponsored Links
  #4  
Old 12th March 2010, 19:59
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
Hi steveauckly !!!

Thanks for the answer...

the biggest problem is that i'm a noob in baan

More inf

---- The baan server is 'x'
---- and the other server is windows.

I'm working on server 'x' and i want to know if a file on windows server exist.
i don't know how to do it.

I just want a yes or not if the file exist on windows server.


*** Sorry but my english is so bad :S
Reply With Quote
  #5  
Old 12th March 2010, 22:09
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
seq.*

Quote:
Originally Posted by Giovanni27 View Post
Hi steveauckly !!!

Thanks for the answer...

the biggest problem is that i'm a noob in baan

More inf

---- The baan server is 'x'
---- and the other server is windows.

I'm working on server 'x' and i want to know if a file on windows server exist.
i don't know how to do it.

I just want a yes or not if the file exist on windows server.


*** Sorry but my english is so bad :S

Hello,

use seq.open.local()
Here's the reference:

BaanERP Programmers Guide


seq.open.local()

--------------------------------------------------------------------------------

Syntax
long seq.open.local( string filename, string mode(2), [long remove.after.use] )
Description
This opens a specified file on the client system. It returns a file pointer, which you can use to identify the file in subsequent operations. The function supports long file names.

Arguments
filename
The name of the file that must be opened. If you do not specify a path name, the file is searched for in the directory where BW is loaded.

mode
The mode in which the file must be opened. This can be one of the following options:

"r" Open for reading.
w" Create for writing.
"a" Open for writing at end of file, or create for writing.

In addition, you can add "t" to any of the above options if you want the file to be opened in text mode.

remove.after.use
Use this optional argument to specify whether or not the file must be removed after it has been closed by seq.close.local():

<>0 file is removed
0 file is not removed


Note
You cannot use seq.*() functions in combination with the seq.*.local() functions. So, you cannot use seq.seek() or seq.rewind(), for example, on a file that was opened with seq.open.local().

Return values
>=0 Success. File pointer is returned.

<0 Error. File could not be opened.

Regards
__________________
//Bernd
Reply With Quote
  #6  
Old 20th March 2010, 06:29
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
heey steveauckly and bdittmar:

thanks a lot...

i tried it and it doesn't have compilation errors but
when it runs the program it ever returns (file.id = 2), the problem is that the file already exist


this is the code.

function set.buscar()
{
select tiban001.item, tiban001.stat
from tiban001 for update
where tiban001.item = “AAA001”
selectdo
item_w = “AAA001” | strip$(tiban001.item)
item_w = item_w&”.PLT”
file.id = seq.open(\\myservde\inf\user\item_w,”r”)
if file.id >= 1 then
tiban001.stat = tcyesno.yes
seq.close(file.id)
else
file.id = seq.open(\\myservde\inf\user\second\item_w,”r”)
if file.id >= 1 then
tiban001.stat = tcyesno.yes
else
tiban001.stat = tcyesno.no
seq.close(file.id)
endif
endif
endselect
}

it returns (file.id = -2)

any idea about the problem?
I try to find the file on a windows server
Reply With Quote
  #7  
Old 20th March 2010, 18:32
sushil's Avatar
sushil sushil is offline
Guru
 
Join Date: Jan 2006
Posts: 451
sushil is on a distinguished road
Baan: BAAN IV C4 - DB: Oracle - OS: Windows
Try Using Local Path instead of network path

file.id = seq.open("C:\filepath\filename.txt",”r”)
Reply With Quote
  #8  
Old 20th March 2010, 18:38
sushil's Avatar
sushil sushil is offline
Guru
 
Join Date: Jan 2006
Posts: 451
sushil is on a distinguished road
Baan: BAAN IV C4 - DB: Oracle - OS: Windows
i think you are trying to use variable in file name. then try this
file.id=seq.open("c:\filepath\" & variable,"r")
Reply With Quote
  #9  
Old 20th March 2010, 19:13
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
Thumbs up

Quote:
Originally Posted by sushil View Post
i think you are trying to use variable in file name. then try this
file.id=seq.open("c:\filepath\" & variable,"r")

Hi !! Sushil

i'll try it, but after 2 days xD because i work monday to friday, and today is saturday in my country xD

thanks a lot =D

a question.. it doesn't matter if the server where i try to find the file is a windows server?

greetings!!
Reply With Quote
  #10  
Old 22nd March 2010, 05:07
sushil's Avatar
sushil sushil is offline
Guru
 
Join Date: Jan 2006
Posts: 451
sushil is on a distinguished road
Baan: BAAN IV C4 - DB: Oracle - OS: Windows
Quote:
Quote:
a question.. it doesn't matter if the server where i try to find the file is a windows server?
Have you ever tried to take Oracle incremental backup using RMAN in Network Drive ??

May be that answers the Q.
Reply With Quote
  #11  
Old 22nd March 2010, 16:24
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
i have tried
file.id = seq.open(\\myservde\inf\user\second\"&item_w,”r”)
but it doesn't returns the file pointer.

when i'm debuggin the session the value of file.id always is -2
but the file exist :S

any idea why the file.id always is -2

(the file exist but id doesn't return a value file.id >= 1 :S

function set.buscar()
{
select tiban001.item, tiban001.stat
from tiban001 for update
where tiban001.item = “AAA001”
selectdo
item_w = strip$(tiban001.item)
item_w = item_w&”.PLT”
file.id = seq.open(\\myservde\inf\user\"&item_w,”r”)
if file.id >= 1 then
tiban001.stat = tcyesno.yes
seq.close(file.id)
else
file.id = seq.open(\\myservde\inf\user\second\"&item_w,”r”)
if file.id >= 1 then
tiban001.stat = tcyesno.yes
else
tiban001.stat = tcyesno.no
seq.close(file.id)
endif
endif
endselect
}
Reply With Quote
  #12  
Old 22nd March 2010, 16:26
Giovanni27 Giovanni27 is offline
Junior Member
 
Join Date: Mar 2010
Posts: 9
Giovanni27 is on a distinguished road
Baan: IV - DB: Unix - OS: Windows, Unix, Sun
i'm a beginner on baan xD
Reply With Quote
  #13  
Old 27th March 2010, 17:03
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
seq.open() ?

Hello Giovanni,

seq.open() is used for files on the BaaN-Application-Server !

seq.open.local() is used for files on the client PC accessing BaaN.

Most UNC (\\server\....) is a problem. Better use drive letters.

Are you able / allowed to create a samba share between your BaaN Server and Windows Server ?

In this case seq.open() maybe work on the samba-dir.

A workaround may be:

create a scheduled batch in your server dir:

FOR %%b IN (*.*) DO @echo %%b>>dirinfo.txt
(Creates a file with all filenames in the directory line by line)

FTP this file to your BaaN box.
After FTP delete the file on WIN Server !

Read the file from BaaN Box with seq.open()


Regards
__________________
//Bernd

Last edited by bdittmar : 28th March 2010 at 11:34. Reason: solution ?
Reply With Quote
  #14  
Old 3rd April 2010, 13:07
oledba oledba is offline
Junior Member
 
Join Date: Mar 2010
Posts: 3
oledba is on a distinguished road
Baan: b4c4 - DB: oracle - OS: Win
listen to what is written above
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
Programming Question mr_suleyman Tools Development 37 11th November 2016 08:14
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 11:35
bshell received SIGTERM manojsharma Tools Development 11 5th June 2008 09:22
How to print Postcript in landscape orientation heliopaixao Tools Administration & Installation 8 28th July 2006 13:39


All times are GMT +2. The time now is 07:56.


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