On Sun, Apr 8, 2012 at 12:39 PM, Paul Gilmartin <[email protected]>wrote:
> On Sun, 8 Apr 2012 11:15:55 -0700, Sam Siegel wrote: > > > >Paul - Thanks for the tips. The code does not create any path segments. > > > You're welcome. > > >My goal here is to be able to point the user to the reference manuals so > >they can determine what is appropriate for their use. It is > >their responsibility to allocate a buffer large enough to hold any > >path/file name they create. When they call my function, they provide the > >address of the buffer and the number of bytes in the buffer. A new buffer > >is allocated (specified size + 2) and the specified number of bytes are > >copied and a tailing x'0000' is appended. My buffer is passed to the > >C/C++ runtime fopen function. If the path/filename provided is invalid, > >the open fails and the error is returned to the caller. > > > Sounds like assembler code insofar as it uses address/length rather > than a null-terminated string. So portability is less a concern. > Actually it is C. The intermediate buffer is used to allow the UNICODE service to translate to ASCII. UNICODE services need to know how much data is being passed in. The code runs POSIX(ON), XPLINK and is compiled the ASCII option. > > >It is > >their responsibility to allocate a buffer large enough to hold any > >path/file name they create. > > In which case, it depends not on a system limit nor on any > limit in your code, but on how long a pathname the user > intends to create. From what I glean from POSIX and the > z/390 C/C++ RTL, the limits are to be regarded as dynamic, > and available from dynamic queries by: > > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/edclb1b0/3.661 > 3.661 pathconf() -- Determine configurable path name variables > > which sounds sort of circular: in order to ask how long a pathname > is allowed, you must provide some sort of pathname (in the same > filesystem?) as input. The operant word is "configurable"; i.e. > subject to change. > > The underlying Assembler callable service is: > > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/bpxzb1b0/2.126 > 2.126 pathconf (BPX1PCF, BPX4PCF) > Thanks ... I will look at both of these manuals. > > (Yes, when I first learned about this, I thought it was BS; PITA.) > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

