lua-users home
lua-l archive

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


It was thus said that the Great nobody once stated:
> On 21/01/2020 06.38, Sean Conner wrote:
> >Okay, let's see if the community can just come together to define the
> >minimum viable module for directory functions. […]
> >
> >	cat = list([name])
> >
> >		Obtain a list of files in the given directory; if not given,
> >		use the current working directory.  Return an array of
> >		names, or nil on error (error reporting TBD).
> >
> >		NOTE: 	The ordering of entries is unspecified.
> >			None of modules I've listed have this specific
> >			functionality.
> >
> >	fun,state,var = glist([name])
> >
> >		Returns an interator (function, state, var) for use in a for
> >		statement.  Each time the function is called, a new filename
> >		is returned.
> >
> >		NOTE:	The ordering of entries is unspecified.
> >			All three modules have this function, although
> >			it's called files() under luaposix.
> 
> What should happen with '.' and '..'?

  Ooh, I forgot to mention that.  The parent and current directory markers
("." and ".." on POSIX systems; I think they're the same on Windows?) should
be removed.

> Should they be excluded?  

  If the concept exists for the system, yes.

  -spc