⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fileutils.java

📁 A framework written in Java for implementing high-level and dynamic languages, compiling them into J
💻 JAVA
字号:
package gnu.kawa.functions;import java.io.*;import gnu.mapping.InPort;public class FileUtils{  /* #ifndef JAVA2 */  // static private int tempFileNumber;  /* #endif */  public static  /* #ifndef JAVA2 */  // synchronized  /* #endif */  File createTempFile (String format)    throws java.io.IOException  {    if (format == null)      format = "kawa~d.tmp";    int tilde = format.indexOf('~');    String prefix, suffix;    File directory = null;    if (tilde < 0)      {        prefix = format;        suffix = ".tmp";      }    else      {        prefix = format.substring(0, tilde);        suffix = format.substring(tilde+2);      }    int sep = prefix.indexOf(File.separatorChar);    if (sep >= 0)      {        directory = new File(prefix.substring(0, sep));        prefix = prefix.substring(sep+1);      }    /* #ifdef JAVA2 */    return File.createTempFile(prefix, suffix, directory);    /* #else */    // if (directory == null)    //   directory = new File(File.separatorChar == '\\' ? "c:\\temp" : "/tmp");    // for (;;)    //   {    //     File temp = new File(directory,    //                          prefix + (++tempFileNumber) + suffix);    //     if (! temp.exists())    //       {    //         OutputStream out = new FileOutputStream(temp);    //         out.close();    //         return temp;    //       }    //   }    /* #endif */  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -