Re: [AD] file system routines |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On December 20, 2008, Matthew Leverton wrote:
> What's the purpose, goal, etc of the file system routines?
> <http://www.liballeg.org/naturaldocs/files/src/fshook-c.html> How do
> they compare to A4's pack files? Is Allegro supposed to use them for
> all I/O?
Yup. Users and allegro alike should use them over any other api.
> Do the names have to be similar to C's I/O? I'd rather see a
> consistent A5 API than trying to emulate a weird legacy one.
>
> e.g. object first, al_fs_entry_iputl(ALLEGRO_FS_ENTRY *f, int32_t i)
>
> Also, functions like:
>
> int32_t al_fs_entry_igetl(ALLEGRO_FS_ENTRY *f)
>
> How do you tell the difference between EOF and -1 (or 0xffffffff)? I
> prefer the following style:
>
> bool al_fs_entry_igetl(ALLEGRO_FS_ENTRY *f, int32_t *i)
I don't really mind any of that, and does fix that little problem of having to
check al_fs_error() or al_fs_eof() all the time (which is what you're supposed
to use atm).
> And what exactly is a "fs_entry"?
Its a Dir or a File. Yes, thats a little strange but I intended for a much
slicker al_find_* set of functions that return AL_FS_ENTRY objects that aren't
opened yet, but have all the necessary info filled in like filename, and stat
info.
> I don't mind the double al_fs_
> prefix as it makes naming conflicts less likely. As such, wouldn't
> al_fs_getc() be just as appropriate?
Probably. But there are some non "entry" functions that just take filenames,
and those would then clash with the others. I tried to make all functions that
take an AL_FS_ENTRY to be named with entry in it. If you want to remove the
helper functions be my guest.
> --
> Matthew Leverton
>
> ---------------------------------------------------------------------------
>---
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx