Re: [AD] About findfirst (2)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> and how about this? it will be needed eventually so why not have it now?

To be consistent with file_size(), I finally chose 'long'. I don't think
files whose size is greater than 2 GB are very common. And I also got rid of
those nasty 'ff' so that I have a working implementation under DOS and
Windows with:

   struct al_ffblk
  {
      int attrib;       - actual attributes of the file found
      time_t time;      - modification time of file
      long size;        - size of file
      char name[1024];  - name of file
  };

int al_findfirst(const char *pattern, struct al_ffblk *info, int attrib);
int al_findnext(struct al_ffblk *info);
void al_findclose(struct al_ffblk *info);

The DOS version is even better than the original findfirst() since it can
differentiate files based on the FA_RDONLY or FA_ARCH flags, unlike
findfirst().

---
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/