Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] funny error msg
- Date: Sat, 28 Aug 2004 01:46:13 -0400
- From: Viktor Pavlenko <vvp@example.com>
- Subject: Re: [tlug] funny error msg
- References: <20040827104928.4FCC.B-ROBSON@example.com><16686.41061.55299.488682@example.com><20040827200802.GT4141@example.com>
>>>>> "MB" == hr <Martin> writes: MB> On Thu, Aug 26, 2004 at 10:45:57PM -0400, Viktor Pavlenko wrote: >> Sometimes simplicity of UNIX doesn't mix well with logic... If I >> change to /tmp/a/ in one shell and then remove it from another, the >> former shell, strangely enough, will not notice that the directory >> is gone: MB> of course not. MB> it is logical too. the same happens if you remove a file. any process MB> that has the file open, will not notice that it is gone. MB> only the entries in the directory are gone because they are removed MB> before the directory is removed itself. Logical? bash runs ls(1) which will try to open(2) the directory and read its content, _every time you run it_. strace shows that open(2) fails: open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 but ls(1) returns 0 for success anyway: fstat64(3, {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40212000 getdents64(3, 0x40212038, 131072) = -1 ENOENT (No such file or directory) munmap(0x40212000, 135168) = 0 close(3) = 0 _exit(0) = ? The behavior is different if the directory is not `.' (you get an error message and 1 as return status). Doesn't look logical to me... -- Viktor
- Follow-Ups:
- Re: [tlug] funny error msg
- From: Edward Middleton
- References:
- [tlug] funny error msg
- From: Brett Robson
- Re: [tlug] funny error msg
- From: Viktor Pavlenko
- Re: [tlug] funny error msg
- From: Martin Bähr
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Sub: best thing on the internet
- Next by Date: Re: [tlug] stdin/stderr redirection under Solaris
- Previous by thread: Re: [tlug] funny error msg
- Next by thread: Re: [tlug] funny error msg
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links