platform.getTempFile

The 'getTempFile' function creates a file name that is unique in the system temporary directory or the specified directory.
getTempFile函数在系统临时文件夹或用户指定目录生成随机的文件名

  • Prototype: platform.getTempFile(sTmpDir, sPrefix, sSuffix);
  • Parameters:

    1. sTmpDir: specifies a directory where a temporary filename is created;
      创建临时文件的目录
    2. sPrefix: specifies a prefix for the temporary file name;
      临时文件名的前缀
    3. sSuffix: specifies a extension name for the temporary file name;
      临时文件名扩展名
  • Return Value: String, a temporary filename is returned;
    返回值:String,返回生成的文件名

  • Example:

    var sTmpFn=platform.getTempFile('/home/username/temp', '~jj', '.tmp');