From: Nikita Danilov <Nikita@Namesys.COM>
To: "\"Andrey Borzenkov\" " <arvidjaar@mail.ru>
Cc: "\"Nikita Danilov\" " <Nikita@Namesys.COM>, linux-kernel@vger.kernel.org
Subject: Re: Are "," and ".." in directory required?
Date: Thu, 10 Jul 2003 14:37:55 +0400 [thread overview]
Message-ID: <16141.16899.777319.699253@laputa.namesys.com> (raw)
In-Reply-To: <E19aYWH-00075R-00.arvidjaar-mail-ru@f25.mail.ru>
"Andrey Borzenkov" writes:
>
>
> -----Original Message-----
>
> >
> > "Andrey Borzenkov" writes:
> > >
> > > Is it possible for readdir to return really empty directory - without
> > > and entry, even "." and ".."?
> >
> > Enter empty directory. Remove it by rmdir() by another process. Now you
> > have a directory without dot and dotdot.
> >
>
> It is not quite the same.
>
> bor@itsrm2% cd foo
> bor@itsrm2% sudo rmdir /tmp/foo
> bor@itsrm2% ls -la .
> .: No such file or directory
>
> how do I access this? OK I could have opendir on it ... but then,
You should access it through getcwd(2). Try 'ls -al'. readdir has
special case for such directories (IS_DEADDIR), so it will come up as
empty without dot and dotdot.
> directory contents is (mur be) still there just like with any
> open unlinked file.
What actually remains in the directory is completely up to the file
system. File system may decide to remove dot and dotdot during rmdir, or
remove some of them, of leave everything to the final iput().
>
> OK, not "possible to return" - it was wrong. Is it allowed? :)
>
> -andrey
Nikita.
next prev parent reply other threads:[~2003-07-10 10:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-10 8:16 Are "," and ".." in directory required? "Andrey Borzenkov"
2003-07-10 10:01 ` Nikita Danilov
2003-07-10 10:19 ` Re[2]: " "Andrey Borzenkov"
2003-07-10 10:37 ` Nikita Danilov [this message]
2003-07-10 11:47 ` "Andrey Borzenkov"
2003-07-10 10:41 ` Oleg Drokin
2003-07-10 12:01 ` Andreas Schwab
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=16141.16899.777319.699253@laputa.namesys.com \
--to=nikita@namesys.com \
--cc=arvidjaar@mail.ru \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.