× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
Vernon,

I'd best elaborate more
I guess there are two separate issues really here

1. converting a (potentially) relative path to an absolute path (i.e. from
root)
2. converting a path (entered as a command parameter) to a path (relative or
absolute) that is "acceptable" to the IBM api's that allow a path parameter.

So, in a logical order I would want to perform point 2. then sometimes point
1. (via 1 or 2 apis preferably)

Currently IBM supports THREE different sets of rules as to what is allowed
in a path (that I know of).

1. At the command parameter value. Supports such things as '~'(Tilde), '\'
instead of '/', redundant '/'s , '.' '..' (dot, double dot). e.g.
'~usrprfname/dir1\\dir2/file.ext' or '../dira//dir2//'  are both valid paths
and are interpreted as being say '/x/y/z/dir1/dir2/file.ext' and
'p/dira/dirb'  There are other special meaning characters too.

2. at the IBM api level. Some of the above special meaning chars are either
not allowed or have a different meaning (e.g. '~'(tilde), '\'(backslash),
'*'(asterisk) ,'?'(question),''' (apostrophe),'"'(quote)

3. Qshell. Supports many more special meaning chars (e.g. '~+', '~-' to
mention just some)

What I am trying to do is write an Os400 Command with the same type of
support that IBM uses (*PName) and then in the CPP use an IFS/Unix Api
without it potentially breaking on the Path field. If for example I used the
paths mentioned in point 1 above and just passed them to the IBM api I would
not get the desired result.
Now I know I could program an algorithm myself (that not my issue), but its
not trivial and it would make sense to use what IBM uses. I'm not even
confident I know all the rules as the documentation is not very clear. I
also want to future-protect it as much as possible.

The second issue of determining an absolute path becomes much easier if the
first issue is solved (i.e. if the path is first 'normalised'. Again, if
there is an easy way of doing it (direct api) why do it the hard way.

hope this clarifies where I'm coming from better.

Rod Orr


-----Original Message-----
From: Vernon Hamberg [mailto:vhamberg@attbi.com]
Sent: Thursday, 15 August 2002 9:52 PM
To: midrange-l@midrange.com
Subject: Re: Api for relative path to absolute path


Take a look at the IFS APIs (under Unix-type). Some use a pathname
structure type  that incudes the separator. They usually start with Qpol*,
and getcwd() gives you the current directory, which you prepend to the
relative object name.

At 06:16 PM 8/15/02 +1000, you wrote:
>This message is in MIME format. Since your mail reader does not understand
>this format, some or all of this message may not be legible.
>--
>[ Picked text/plain from multipart/alternative ]
>Does anyone know of an api that will convert a relative-path to an
>absolute-path. Preferably it would support (by expanding/converting)
>directives such as '\'  '~/'  '~\'  '~userprf/' etc supported by IBM
command
>processor but not by IBM IFS/Unix APIs.
>
>Rod Orr




**********************************************************************
This email may be confidential and/or privileged. Only the intended
recipient may access or use it. Any dissemination, distribution or
copying of this email is strictly prohibited. If you are not the
intended recipient please notify us immediately by return email and
then erase the email.

We use virus scanning software but exclude all liability for viruses
or similar in any attachment or message...,..,..,.


**********************************************************************



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.