GPFiles.java 1006 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Body of GPFiles interface.
  3. // This file implements the code of the GPFiles.cp file.
  4. // dwc August 1999.
  5. package CP.GPFiles;
  6. import java.io.*;
  7. public class GPFiles {
  8. public static char pathSep = System.getProperty("path.separator").charAt(0);
  9. public static char fileSep = System.getProperty("file.separator").charAt(0);
  10. public static char optChar = '-';
  11. public static boolean isOlder(GPFiles_FILE first, GPFiles_FILE second) {
  12. return (first.f.lastModified() < second.f.lastModified());
  13. }
  14. public static void MakeDirectory(char[] dirName) {
  15. File path = new File(CP.CPJ.CPJ.MkStr(dirName));
  16. if (!path.exists()) {
  17. boolean ok = path.mkdirs();
  18. }
  19. }
  20. public static char[] CurrentDirectory() {
  21. String curDir = System.getProperty("user.dir");
  22. return curDir.toCharArray();
  23. }
  24. public static boolean exists(char[] dirName) {
  25. File path = new File(CP.CPJ.CPJ.MkStr(dirName));
  26. return path.exists();
  27. }
  28. }