latex3 / l3sys-query

System queries for LaTeX using Lua
MIT License
1 stars 1 forks source link

Adding more query types #10

Open eg9 opened 1 month ago

eg9 commented 1 month ago

This is a feature request. Presently the only queries are

pwd
ls

but I believe that there are other useful features that could be added. Looking at texosquery my list would be

osname
osversion
date-time
time-zones
tmpdir

There is already the ifplatform package, but it requires shell-escape (otherwise it just distinguish between Windows or not Windows). Possibly osversion is not that important as well as tmpdir. On the other hand, date-time and time-zones can be very useful; currently pdftex and luatex can provide very compact date information already, but xetex and perhaps ptex based engines don't.

muzimuzhi commented 1 month ago

currently pdftex and luatex can provide very compact date information already, but xetex and perhaps ptex based engines don't.

If you meant \pdfcreationdate and \pdffilemoddate pdfTeX primitives, they are both required by the l3kernel (see here) hence both have engine-independent expl3 correspondences: \c_sys_timestamp_str and \file_timestamp:n.

car222222 commented 1 month ago

I was wondering what the queries such as: date-times and time-zone were intended to supply.
Please explain the details.

eg9 commented 1 month ago

@muzimuzhi @car222222

You can look at the documentation of texosquery. The OS is able to provide faster access to a wealth of information about dates and time zones. This information is obviously accessible with LuaTeX, but not with other engines. With \(pdf)creationdate only the time zone offset is available, not the ID or daylight saving.

This might simplify the working of packages such as datetime2, for instance.