DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(m4.info.gz) Maketemp

Info Catalog (m4.info.gz) Sysval (m4.info.gz) UNIX commands
 
 Making names for temporary files
 ================================
 
    Commands specified to `syscmd' or `esyscmd' might need a temporary
 file, for output or for some other purpose.  There is a builtin macro,
 `maketemp', for making temporary file names:
 
      maketemp(TEMPLATE)
 
 which expands to a name of a non-existent file, made from the string
 TEMPLATE, which should end with the string `XXXXXX'.  The six `X''s are
 then replaced, usually with something that includes the process id of
 the `m4' process, in order to make the filename unique.
 
      maketemp(`/tmp/fooXXXXXX')
      =>/tmp/fooa07346
      maketemp(`/tmp/fooXXXXXX')
      =>/tmp/fooa07346
 
    As seen in the example, several calls of `maketemp' might expand to
 the same string, since the selection criteria is whether the file exists
 or not.  If a file has not been created before the next call, the two
 macro calls might expand to the same name.
 
    The builtin macro `maketemp' is recognized only when given arguments.
 
Info Catalog (m4.info.gz) Sysval (m4.info.gz) UNIX commands
automatically generated byinfo2html