Hi Martin,

> I'm not sure about the APIs, but in that snippet above you don't have
> RetVal defined.  Did you perhaps mean to type %addr(dh)?

It's implied that dh is a pointer, since that's what opendir() returns.
It's also implied that RetVal is a character string, since that's what
getcwd() loads into it's first parameter.

Passing %addr(dh) as the first parameter to opendir() would be a very bad
idea.  In fact, you should make sure that NOTHING changes the value of dh
between the time you call opendir() and the time you call closedir()
because otherwise you won't be able to free-up the resources that
opendir() allocated.

In any case, though, loading the name of the current directory into a
pointer field doesn't make any sense...  pointers can only store
addresses, they can't store pathnames.  You'd have "unpredicatable
results" :)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.