Discussion:
[ast-developers] Directory walker API which takes directory fd as input?
Lionel Cons
2013-06-17 14:22:36 UTC
Permalink
Does libast have a directory walker API which can take a directory fd
(for openat()) as input to define the starting point?

Lionel
Glenn Fowler
2013-06-17 14:42:58 UTC
Permalink
no -- that's a good point
we would probably add fts_openat(path, fd, flags, comparf)
and extend the *at() semantics to allow path==0 to use fd already in hand
Post by Lionel Cons
Does libast have a directory walker API which can take a directory fd
(for openat()) as input to define the starting point?
Lionel
Cedric Blancher
2013-06-17 14:49:52 UTC
Permalink
Post by Glenn Fowler
no -- that's a good point
we would probably add fts_openat(path, fd, flags, comparf)
and extend the *at() semantics to allow path==0 to use fd already in hand
If you do so please include Olga Kryzhanovska's patch from
http://lists.research.att.com/pipermail/ast-developers/2012q3/001777.html
to pass the cwd directory fd to the libcmd builtins.
Post by Glenn Fowler
Post by Lionel Cons
Does libast have a directory walker API which can take a directory fd
(for openat()) as input to define the starting point?
Lionel
_______________________________________________
ast-users mailing list
ast-users at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-users
Ced
--
Cedric Blancher <cedric.blancher at googlemail.com>
Institute Pasteur
Roland Mainz
2013-07-06 00:38:52 UTC
Permalink
Post by Glenn Fowler
Post by Lionel Cons
Does libast have a directory walker API which can take a directory fd
(for openat()) as input to define the starting point?
no -- that's a good point
we would probably add fts_openat(path, fd, flags, comparf)
BTW: Such code should avoid using |chdir()| (no longer being needed
with the |*at()| API) and use |readdir_r()| to make the code fully
thread-safe...
Post by Glenn Fowler
and extend the *at() semantics to allow path==0 to use fd already in hand
Erm... AFAIK you mean path=="." in this case ?

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Loading...