lua-users home
lua-l archive

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


Peter Hill escribió:

> There seems to be a variety of places to intercept. Perhaps there should
be
> a single internal function (eg, "io.checkpath") that all these functions
> use. It could take the specified path and return the real path (or nil if
> the specified path is invalid).

> It could be used to restrict access to full paths (returns argument
> unchanged unless access is invalid) or to redirect access (prepending a
full
> path onto the argument).

I like that idea for its simplicity, and it would definitely be useful in
some instances.

However, I think the real world is slightly more complex. Checkpath would
at least want to know whether you were planning to read, write, or execute
the file (or possibly even dynamically load it as a DLL or equivalent).
These might all have different access restrictions.

By the way, writing a checkpatch function would be very OS specific. So
that leaves it wobbling on top of the slippery slope....

R.