lua-users home
lua-l archive

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



On 17-Oct-06, at 9:08 PM, Mike Panetta wrote:

Only thing I am worried about is if this library only handles the least common denominator (which seems to be windows, atleast in one of the cases you mention below) then the library will not truly solve the problem of different people going off and doing their own thing, because there are people out there that need the 'extra' features (like me, and I am very sure I am not the only one).

Yes, I think that would be a mistake.

Posix, as has been mentioned, does not require every single feature to be implemented. However, it defines how features should be implemented if they exist.

To take an example which came up on IRC today, it is not clear how to implement symlinks on Windows. On the other hand, it is not guaranteed that a given symlink can be created on a given filesystem. So anyone trying to create a symlink needs to check the error return. If a particular OS didn't implement symlinks at all, it would be legitimate for the implementation of <whatever>.symlink() to simply return an error code, perhaps EPERM (which is apparently what Linux returns if you try to create a symlink on a filesystem which doesn't support them.)

Speaking of EPERM and friends, I'm of the opinion that "posix-like" error codes should be returned as strings ("EPERM") rather than whatever number happens to be the value of EPERM on the particular os. The strings are a lot easier to deal with in script code, and there's no point I can see to defining errno.EPERM as some number rather than just having the API return "EPERM".