Am 14.10.25 um 19:17 schrieb Hans Hagen via ntg-context:

On 10/14/2025 6:53 PM, Henning Hraban Ramm wrote:
Hi again,
Lua has no function to check if a file exists.
ATM I’m using this:

function userdata.file_exists(name)
   local f=io.open(name,"r")
   if f~=nil then io.close(f) return true
   else return false end
end

Is there anything (better) in ConTeXt?

to grep or not to grep ...

io.exists(filename)
lfs.isfile(filename)

and some more, depending on needs

Thank you! I still didn’t earn my yellow belt in grep-fu.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to