Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
28%
500 - 800 GB
3%
800 - 1200 GB
8%
1200 - 1500 GB
8%
1500 - 2000 GB
12%
> 2000 GB
24%
Total votes: 78

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th October 2019, 06:53
Arlina Arlina is offline
Member
 
Join Date: Feb 2019
Posts: 35
Arlina is on a distinguished road
Baan: Infor LN - DB: MSSql - OS: Windows
Local path access
Baan: Baan IVc
C/S: None/Unknown

Hi All,

Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?

Thanks & Regards,
Arlina
Reply With Quote
  #2  
Old 15th October 2019, 10:33
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 79
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by Arlina View Post
Hi All,

Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?

Thanks & Regards,
Arlina
Try using
Code:
function long seq.fstat.local  (string filename, ref long nr.bytes)
Regards,
Reply With Quote
  #3  
Old 16th October 2019, 07:08
Arlina Arlina is offline
Member
 
Join Date: Feb 2019
Posts: 35
Arlina is on a distinguished road
Baan: Infor LN - DB: MSSql - OS: Windows
Thanks, but seq.fstat.local() returns file size.
I am moving a file to the local machine and what I want to know is whether the particular folder exists on the local machine and if it does, then does the user has write permissions to move the file in the folder.
Reply With Quote
  #4  
Old 25th October 2019, 01:22
v_kewl v_kewl is offline
Member
 
Join Date: Dec 2008
Posts: 59
v_kewl is on a distinguished road
Baan: LN 6.1 - DB: MS SQL - OS: Windows 2003
Batch FIle Can be used to Determine Access

You can create a batch file and place it at client machine or use server2client at run time move.
Call the batch file through baan script and read the output generated by it.
Run Batch commands to check Directory exists or not and Try creating a test file, and put the output of both actions in a file. Read the output file to determine both conditions.

Regards
Reply With Quote
  #5  
Old 25th October 2019, 02:59
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,107
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
You can use the Standard function -
Quote:
create.local.file()
Syntax:
#include <bic_desktop>

function long create.local.file (string filename)

Description

Deprecated. This creates a specified file on a client system. You must have write permission in the parent directory to do this. Access permissions for the new file are set to read and write, for all users. When the file does already exist, it will be truncated.


Arguments
string filename The full path name of the file. For example: create.local.file("C:\Program Files\mydir\myfile") The filename parameter may include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of WebUI.


Return values
0 Success.
<>0 Error. Probably no permission.

Context
This function is implemented in the 4GL Engine and can be used in all script types.

This function is marked as 'untrusted' and can therefore only be used in trusted objects. More about trusted and not trusted objects can be found in the section about managed execution..

Notes
This function is not supported in LN UI. See the Implementing LN UI support for more information.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #6  
Old 25th October 2019, 09:59
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 79
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by Arlina View Post
Thanks, but seq.fstat.local() returns file size.
I am moving a file to the local machine and what I want to know is whether the particular folder exists on the local machine and if it does, then does the user has write permissions to move the file in the folder.
seq.fstat.local() is going to tell you if the file is present or not...
There is no option which I am aware of to find if the folder has write permission.
Just download it and see what the return error code to user.
Cant see other option programatically.

Regards,
Reply With Quote
Sponsored Links
  #7  
Old 25th October 2019, 10:27
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Thailand, Bangkok
Posts: 221
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
Quote:
Originally Posted by Arlina View Post
Hi All,

Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?

Thanks & Regards,
Arlina
You can try to create a dummy file into the destination folder.
If the file can be created then you are good to go, else there is some error whether the folder does not exist or permission denied.
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
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 12:35
Webtop: browse to local file sa_sch Tools Development 5 5th November 2013 03:00
Local to Local File transfer maneesh_jain Tools Development 1 25th September 2009 10:48
How to print Postcript in landscape orientation heliopaixao Tools Administration & Installation 8 28th July 2006 14:39
stpapi.synchronize.dialog() not working in whltc1500m000 RobertB AFS/DDC/OLE: Function servers 7 14th April 2005 08:52


All times are GMT +2. The time now is 06:22.


©2001-2018 - Baanboard.com - Baanforums.com