delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/12/27/02:55:21

Date: Wed, 27 Dec 2000 09:53:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Draft patch for opendir() extension
In-Reply-To: <NEBBIOJNGMKPNOBKHCGHGEBECAAA.tim.van.holder@pandora.be>
Message-ID: <Pine.SUN.3.91.1001227095320.8380E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 27 Dec 2000, Tim Van Holder wrote:

> > The above just passes the name of the file, not the directory where it
> > ``lives''.
> Hmm. I thought that an fsext_open hook got the name as passed to open().

It does.

Did you plan to have fsext_open hook be the place where these fake
entries are registered?

> If not, how would the /dev/zero support know it's being asked for
> /dev/zero and not d:/my/favorite/numbers/zero?

The case of "d:/my/favorite/numbers/zero" is easy, but what about
"d:/dev/zero"?

> Without fsext_entry, I'd need to rely solely on num_read, leading to:
> 
>  num_read < need_fake_dot_dotdot ?
>   => return fake . or ..
>  otherwise ?
>   => idx = num_read - need_fake_dot_dotdot
>      for (i = 0; i < idx; ++i)
>        if (fsext_entries[i] == NULL)
>          break;
>      }

Why isn't fsext_entries[num_read - need_fake_dot_dotdot] good enough?
Since num_read never gets past the NULL entry in fsext_entries[], you
don't need the above loop and other complications.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019