[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changes to the filesystem while find is running - comments?
From: |
Martin Buchholz |
Subject: |
Re: Changes to the filesystem while find is running - comments? |
Date: |
Wed, 24 Nov 2004 19:15:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20040414 |
address@hidden wrote:
>>I can see that that would be useful but it would fail to comply with
>>the POSIX standard, which specifies:
>>
>> The find utility shall be able to descend to arbitrary
>> depths in a file hierarchy and shall not fail due to path
>> length limitations (unless a path operand specified by the
>> application exceeds {PATH_MAX} requirements)
>
> But PATH_MAX is limited and the number of file descriptors is perhaps
> not.
>
> (On Solaris, PATH_MAX is 1024 so you require at most 512 file
> descriptors to keep the stack of directories: 512 is less than the
> default hard limit of 65536 file descriptors per process [S9, S8
> and before used 1024, still >> 512)
My reading of the above paragraph from the POSIX standard is
that find is required to be able to traverse arbitrary
depths, even when the resulting path length exceeds PATH_MAX.
On my Solaris 9 system, the default file descriptor limit
appears to be 256.
I am genuinely surprised that Solaris still has such a
relatively small PATH_MAX. Linux has 4096.
Like other arbitrary system limits of its ilk, PATH_MAX
is evil, and is one of the more persuasive arguments for
getting rid of the C language and its fixed-size
stack-allocated buffers.
char path[PATH_MAX]; /* considered harmful */
Martin
> Casper
- Re: Changes to the filesystem while find is running - comments?, (continued)
- Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/23
- Re: Changes to the filesystem while find is running - comments?, Martin Buchholz, 2004/11/23
- Re: Changes to the filesystem while find is running - comments?, Casper . Dik, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, Elizabeth Zwicky, 2004/11/25
- Re: Changes to the filesystem while find is running - comments?, Martin Buchholz, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, Casper . Dik, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, Casper.Dik, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, Doug Moen, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?, Casper . Dik, 2004/11/24
- Re: Changes to the filesystem while find is running - comments?,
Martin Buchholz <=
- Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/25
- Re: Changes to the filesystem while find is running - comments?, Casper.Dik, 2004/11/25
- Re: Changes to the filesystem while find is running - comments?, devnull, 2004/11/25
Re: Changes to the filesystem while find is running - comments?, Solar Designer, 2004/11/23
Re: Changes to the filesystem while find is running - comments?, James Youngman, 2004/11/24
Re: Changes to the filesystem while find is running - comments?, Martin Buchholz, 2004/11/23
Re: Changes to the filesystem while find is running - comments?, Troy, 2004/11/23