[top][index]
search for:

temporaryFileName -- make a temporary file name

Synopsis:

  • Usage: y = temporaryFileName()
  • Input:

  • Output:
  • y: a unique temporary file name.
  • The file name is so unique that even with various suffixes appended, no collision with existing files should occur. But no check is done to see whether such files are present.

    i1 : temporaryFileName () | ".tex"

    o1 = /tmp/M2-25546-1.tex
    i2 : temporaryFileName () | ".html"

    o2 = /tmp/M2-25546-2.html

    This function will work under Unix, and also under Windows if you have a directory on the same drive called tmp.

    Code:

         -- ../../../Macaulay2/m2/files.m2:8-11
         temporaryFileName = () -> (
              counter = counter + 1;
              "/tmp/M2-" | toString processID() | "-" | toString counter
              )

    [top][index]
    search for: