[luatex] readlink?

Taco Hoekwater taco at elvenkind.com
Mon Mar 1 18:50:09 CET 2010


Hi,

Elie Roux wrote:
> Hello,
> 
> during some scripting for a font database to be used with LuaLaTeX, I 
> encountered two difficulties (Unix-only) :
> - I couldn't know if I had the permission or not to write on a file: 
> lua.attributes() gives me uid, gid and the persmission string, but this 
> is unusable as I don't know what is the uid of the program, and I know 
> even less if I'm in a group that fits the permissions...

Why not just do io.open(,"w") ? if it fails, you couldn't write. And
such a test will do the 'right thing' if the disk is full or mounted
read-only.

> - I couldn't know where the symlinks were pointing to

lfs has lfs.symlinkattributes() for this, but I have never
used it so I am not sure how useful that is.

> A solution to these two problems would be the inclusion of the posix[1] 
> library. 

Libraries that do not run on win32 are definitely out of the question.

Best wishes,
Taco


More information about the luatex mailing list