Re: [AD] for_each_file not working |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sun, 7 Oct 2001, Bob wrote:
> Eric Botcazou wrote:
>
> >>r = for_each_file("data/*.lvl", 0, load_level, 0);
> >>
> >
> > This line means: for each file in the data directory whose extension is
> > 'lvl' and for which no file attribute is set, call 'load_level' with 0 as
> > data (see the docs, section file and compression routines).
> >
> > Either remove all file attributes from your *.lvl files or extend the set of
> > searched attributes.
>
>
> So how can tell it "Show all files but not directories or volume labels"?
> FA_ARCH is not enough, since a file may not have it's archive attribute set.
> This also needs to be compatible with Linux, BeOS, ...
Try (FA_RDONLY | FA_ARCH | FA_HIDDEN | FA_SYSTEM) as attributes. Simply
take all the flags (those, which are guaranteed to work everywhere - see
docs) and omit those which you don't want. This is DOSism and should be
burned deeply under the ground, but...
Have a nice day.
Stepan Roh