[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ftw/nftw is limited by stack size

From: Jim Meyering
Subject: Re: ftw/nftw is limited by stack size
Date: Fri, 17 Jan 2003 19:27:31 +0100

>> Yes, but should every application that uses ftw -- and that wants
>> to avoid that limitation -- have to go to such lengths?
> Most of apps expect that max. path length is PATH_MAX, and fail misserably
> when faced longer path - for example getcwd() & co. returns truncated path
> silently on some kernels... And as you cannot pass paths longer than
> PATH_MAX to open/stat anyway...

While it is true that many applications fail when applied to a hierarchy
that is 40,000 levels deep, that doesn't mean it is necessary or
desirable.  For a few key tools (rm, du, and find come to mind), such
hierarchies should pose no problem.  I've already fixed GNU `rm'.

Currently that limitation affects GNU du, and that makes it impossible
for one to use du on a hierarchy containing such a deep subtree.

All the PATH_MAX limitation means is that each command line argument must
not be too long.  It does not mean that -- given reasonable command line
arguments -- applications should be free to give up just because functions
like stat cannot operate on a full path name of a subdirectory.  Instead,
such applications can use chdir as necessary to descend into affected
directories where they can then operate directly on each directory entry.

Ideally, such applications could also use ftw with it's FTW_CHDIR option.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]