From: Benoit Fouet <benoit.fouet@purplelabs.com>
To: kratzers@pa.net
Cc: Nikola <root.admin1@zg.t-com.hr>, linux-c-programming@vger.kernel.org
Subject: Re: ftw , nftw doesn't work
Date: Wed, 25 Apr 2007 15:43:20 +0200 [thread overview]
Message-ID: <462F5AF8.6010108@purplelabs.com> (raw)
In-Reply-To: <200704250916.43481.kratzers@pa.net>
Stephen Kratzer wrote:
> 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.
>
and compiling with warning outputs could have helped, too :)
$ gcc -Wall test.c
surely leads to a "control reaches end of a non void function" or
something similar...
Ben
--
Purple Labs S.A.
www.purplelabs.com
next prev parent reply other threads:[~2007-04-25 13:43 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
2007-04-25 13:43 ` Benoit Fouet [this message]
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=462F5AF8.6010108@purplelabs.com \
--to=benoit.fouet@purplelabs.com \
--cc=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).