From: Stephen Kratzer <kratzers@pa.net>
To: Nikola <root.admin1@zg.t-com.hr>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: ftw , nftw doesn't work
Date: Wed, 25 Apr 2007 09:16:42 -0400 [thread overview]
Message-ID: <200704250916.43481.kratzers@pa.net> (raw)
In-Reply-To: <462F4D67.5090600@zg.t-com.hr>
On Wednesday 25 April 2007 08:45:27 Nikola wrote:
> Hi,
>
> I am trying to parse dir tree with ftw and nftw on Linux (debian) but
> without result.
>
> ------------------------------------------------------
>
> #include <stdio.h>
> #include <ftw.h>
>
>
> int fn(const char *file, const struct stat *sb, int flag){
>
> printf("-->\n");
> }
>
>
> int main(int argc,char **argv){
>
>
> ftw("/etc/", fn, 5);
>
> return 0;
> }
>
> ------------------------------------------------------
>
> bash# gcc test.c
> bash# ./a.out
> -->
> bash#
>
> ------------------------------------------------------
>
> Does anyone knows what might be the problem.
>
> tnx in advance.
>
The return value of fn should be 0 if you want the walk to continue past the
first file or directory.
next prev parent reply other threads:[~2007-04-25 13:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 12:45 ftw , nftw doesn't work Nikola
2007-04-25 13:16 ` Stephen Kratzer [this message]
2007-04-25 13:43 ` Benoit Fouet
2007-04-25 14:05 ` leslie.polzer
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=200704250916.43481.kratzers@pa.net \
--to=kratzers@pa.net \
--cc=linux-c-programming@vger.kernel.org \
--cc=root.admin1@zg.t-com.hr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).