9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: lucho@ionkov.net (Latchesar Ionkov)
Subject: [9fans] Listing a directory
Date: Wed,  9 Mar 2011 16:38:26 -0700	[thread overview]
Message-ID: <AANLkTi=uV8wvCjMqgQJU18cToR=HzYQsj3m37wXbAowe@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=dmNgkGfqnCbAg9J-UEhpYP_m1Sv-zO_j8HGz4@mail.gmail.com>

I don't think there is a way for you to get a coherent listing no
matter what you do. Files may be created and removed all the time, so
coherent listing doesn't have much sense.

In some cases it may be reasonable to atomically create a copy of the
directory listings (some of my file servers do), but I wouldn't like
to see it as required for all 9P implementations.

Thanks,
    Lucho

On Mon, Mar 7, 2011 at 6:09 PM, Venkatesh Srinivas <me at acm.jhu.edu> wrote:
> Hi,
>
> In 9P, if I wish to list a directory, I need to TWalk to the directory,
> TOpen the directory fid from the walk, and then TRead till I have all of the
> contents of the directory.
> If the directory's contents do not fit in a single read, I imagine I need to
> loop around TOpen / Tread / .... / Tread / TOpen, till I get the whole
> contents and see the same QIDs in each open, to get a coherent listing. (is
> this accurate?)
>
> Unfortunately, a TOpened FID to a directory cannot be used for walking it
> (why?); so the only use of a TOpened fid to a directory is to list it or to
> get a QID. Would it be reasonable for a TOpened fid to a directory to create
> a copy of the directory listing at the time of the RPC?
>
> -- vs
>



      parent reply	other threads:[~2011-03-09 23:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  1:09 Venkatesh Srinivas
2011-03-08  1:17 ` Eric Van Hensbergen
2011-03-09 23:38 ` Latchesar Ionkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=uV8wvCjMqgQJU18cToR=HzYQsj3m37wXbAowe@mail.gmail.com' \
    --to=lucho@ionkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).