Feedback
Did this article resolve your question/issue?

   

Article

Problems accessing file system resources in parallel relative path

Information

 
TitleProblems accessing file system resources in parallel relative path
URL Nameproblems-accessing-file-system-resources-in-parallel-relative-path
Article Number000118093
EnvironmentProduct: OpenEdge
Version: All Supported Versions
OS: AIX
Question/Problem Description

Attempting to access resources via parallel relative path results in errors.  
For example: ../../myresource

The problem only happens in production, not in test environment.
The problem doesn't happen when using explicit path references.

Examples of some errors are:
SAX-PARSE-FIRST, Error parsing file: unable to open primary document entity ''. (14586)

  • The above error occurs when attempting to read a file using a reference like below
"../../blah/blah/folder/file.xml"

** Cannot find or open file /dbdir/dbname.db, errno = 2. (43)
  • The above error likewise occurs when attempting to connect to a db in the below path:
"../../blahdir/db/database.db"
 
 
Steps to Reproduce
Clarifying Information
Error MessageSAX parser error: , . (14586)
** Cannot find or open file <file-name>, errno = <number>. (43)
Defect/Enhancement Number
Cause
Using truss to analyze what is happening at the OS level when these errors are shown, it is apparent that the session doesn't have permission to access to the folder above the working directory.

The truss output shows a statx call that fails with err#13 when searching for the file in the path like ./../../.

In this case the user did not have permission to access the folder above working directory, so statx was unable to resolve the path.
 
Resolution
Either ensure that the user can access the interim folders when using such path references or ...

Resolve the path references to an explicit path.
One way to accomplish this within the language would be to assign the relative reference to FILE-INFO:FILE-NAME and use the output of FILE-INFO:FULL-PATHNAME to reference the file.

For example:
DEFINE INPUT PARAMETER pcFileRef AS CHARACTER   NO-UNDO.

FILE-INFO:FILE-NAME = pcFileRef.
IF FILE-INFO:FULL-PATHNAME NE ? THEN
    hSaxReader:SET-INPUT-SOURCE("FILE",FILE-INFO:FULL-PATHNAME).

or
 
FILE-INFO:FILE-NAME = cDbReference.

IF FILE-INFO:FULL-PATHNAME NE ? THEN
    CONNECT VALUE("-db " + FILE-INFO:FULL-PATHNAME).

​​​​​​​
Workaround
Notes
Last Modified Date9/24/2019 10:26 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.