lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, Dec 18, 2009 at 12:01 AM, Sean Conner <> wrote:
>  Under MS-DOS (and I assume, Windows), you have the following:
>        FindFirstFile()  - return first file in current working directory
>        FindNextFile()   - return the next matching file
>  FindFirstFile() only works for the current working directory (unlike
> Unix), it takes a simple file regex (a file glob) and some flags (include
> archive files, read-only files, system files, etc) and fills in a structure
> (the address of which is passed in first via another function) with the
> following information (for Unix, another all is needed to obtain this
> information):
>        name
>        extention       (note: Unix does not use extentions---applications
>                        might, but not the OS itself)
>        timestamp
>        filesize
>        attribute       (hidden, system, read-only, etc)

Your assumption is incorrect - under Windows things are slightly
different (read
FindFirstFile() works for any directory, does not take any flags, and
takes the address of the structure directly. Said structure then
* attributes
* multiple timestamps (creation time, access time, write time)
* filesize
* filename
And of course, don't forget FindClose() to clean things up.