From mboxrd@z Thu Jan 1 00:00:00 1970 From: lucho@ionkov.net (Latchesar Ionkov) Date: Wed, 9 Mar 2011 16:38:26 -0700 Subject: [9fans] Listing a directory In-Reply-To: References: Message-ID: Topicbox-Message-UUID: ba198dec-ead6-11e9-9d60-3106f5b1d025 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 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 >