× 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.



Thanx for looking that up. I'll change it to 255.

@Scott ... and look how getwd is used just to be safe.

Thanx all.

Mihael


-----Original Message-----
From: Mike Amos [mailto:yl_mra@xxxxxxxxx]
Sent: Thursday, December 09, 2010 7:16 PM
To: C programming iSeries / AS400
Cc: Schmidt, Mihael
Subject: Re: getwd not available

Michael,

You have to be careful with PATH_MAX under IBM i. Although fully posix
compliant functions may allow PATH_MAX of 1024, not all of the c
functions do.

From stdio.h
#ifndef PATH_MAX
#ifndef __IFS_IO__
#define PATH_MAX 39
#else
#define PATH_MAX 255
#endif
#endif

See specific documentation for getconf()
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/rzahz/rzahzgetconf.htm
and pathconf()
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/pathconf.htm

Mike

On 12/09/2010 08:59 AM, Schmidt, Mihael wrote:
Hi,

as getwd is not available on IBM i but getcwd is, is it safe to do the following:

#define PATH_MAX 1024
#define getwd(buffer) getcwd(buffer, PATH_MAX)

Thanx in advance

Mihael Schmidt
Anwendungsentwicklung

Dirk Rossmann GmbH
Iserhägener Str.16
30938 Burgwedel
* +49 (05139) 898 - 4353

Handelsregister-Nr. HRB 120546, Amtsgericht Hannover
Ust-Id-Nr. DE 115055186
St.-Nr. 16 / 205 / 65401
Geschäftsführer: Dirk Roßmann, Alice Schardt-Roßmann, Roland Frobel, Klaus Praus




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.