Skip to content

Clarify that io.readdir handles are iterated with lines() - #594

Open
marcellotmartins wants to merge 1 commit into
citizenfx:masterfrom
marcellotmartins:docs/clarify-io-readdir-iteration
Open

Clarify that io.readdir handles are iterated with lines()#594
marcellotmartins wants to merge 1 commit into
citizenfx:masterfrom
marcellotmartins:docs/clarify-io-readdir-iteration

Conversation

@marcellotmartins

Copy link
Copy Markdown

The directory listing example in the sandbox docs already used the handle's lines() iterator, but never stated that the returned value is a handle (not a plain table) and therefore cannot be iterated with ipairs or pairs.

This adds a short sentence before the iteration example to prevent that common confusion.

Closes #518.

The directory listing example already used the handle's lines() iterator,
but never stated that the handle is not a plain table and therefore cannot
be iterated with ipairs or pairs. Add a short note before the iteration
example to prevent that common confusion.

Closes citizenfx#518.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

io.readdir is not iterable with ipairs

1 participant