Diamond Control Suite 3.0

diamondedge.util
Class FileSystem

java.lang.Object
  extended by diamondedge.util.FileSystem

public class FileSystem
extends Object


Constructor Summary
FileSystem()
           
 
Method Summary
static void close()
           
static void close(int fileNum)
           
static int getAttr(File file)
          File attributes
static int getAttr(String pathName)
           
static String getBaseName(String path)
          Return the BaseName from a path
static String getDriveName(String path)
          Return drive from a path
static String getExtensionName(String path)
          Return the Extension from a path
static Date getFileDateTime(String pathName)
           
static int getFileLen(int fileNum)
          returns the length of the file
static int getFileLen(String pathName)
          returns the length of the file
static int getFileLoc(int fileNum)
          returns the location (file position) in the input file
static int getFreeFile()
           
static InputFile in(int fileNum)
           
static boolean isEOF(int fileNum)
           
static void kill(String pathName)
          Deletes the file
static File mkDir(String pathName)
           
static AppendFile openAppend(String path, int fileNum)
           
static RandomAccessFile openFile(String fileName, int openMode)
           
static RandomAccessFile openFile(String fileName, String openMode)
           
static InputFile openInput(String path, int fileNum)
           
static OutputFile openOutput(String path, int fileNum)
           
static OutputFile out(int fileNum)
           
static String readString(RandomAccessFile file, int nChars)
           
static void rmDir(String pathName)
           
static int seek(int fileNum)
          Returns aLong specifying the current read/write position within a file opened using the Open statement.
static void seek(int fileNum, int pos)
          Sets the position for the next read/write operation within a file opened using the Open statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystem

public FileSystem()
Method Detail

getFreeFile

public static int getFreeFile()

in

public static InputFile in(int fileNum)

out

public static OutputFile out(int fileNum)

openInput

public static InputFile openInput(String path,
                                  int fileNum)
                           throws IOException
Throws:
IOException

openOutput

public static OutputFile openOutput(String path,
                                    int fileNum)
                             throws IOException
Throws:
IOException

openAppend

public static AppendFile openAppend(String path,
                                    int fileNum)
                             throws IOException
Throws:
IOException

close

public static void close()
                  throws IOException
Throws:
IOException

close

public static void close(int fileNum)
                  throws IOException
Throws:
IOException

isEOF

public static boolean isEOF(int fileNum)
                     throws IOException
Throws:
IOException

getFileDateTime

public static Date getFileDateTime(String pathName)
                            throws IOException
Throws:
IOException

getFileLen

public static int getFileLen(String pathName)
                      throws IOException
returns the length of the file

Throws:
IOException

kill

public static void kill(String pathName)
                 throws IOException
Deletes the file

Throws:
IOException

getFileLoc

public static int getFileLoc(int fileNum)
                      throws IOException
returns the location (file position) in the input file

Throws:
IOException

getFileLen

public static int getFileLen(int fileNum)
                      throws IOException
returns the length of the file

Throws:
IOException

mkDir

public static File mkDir(String pathName)
                  throws IOException
Throws:
IOException

rmDir

public static void rmDir(String pathName)
                  throws IOException
Throws:
IOException

seek

public static int seek(int fileNum)
                throws IOException
Returns aLong specifying the current read/write position within a file opened using the Open statement.

Throws:
IOException

seek

public static void seek(int fileNum,
                        int pos)
                 throws IOException
Sets the position for the next read/write operation within a file opened using the Open statement.

Throws:
IOException

getDriveName

public static String getDriveName(String path)
Return drive from a path


getBaseName

public static String getBaseName(String path)
Return the BaseName from a path


getExtensionName

public static String getExtensionName(String path)
Return the Extension from a path


getAttr

public static int getAttr(File file)
                   throws IOException
File attributes

Returns:
    Constant Value  Description
    Normal      0   Normal file. No attributes are set.
    ReadOnly    1   Read-only file.
    Hidden      2   Hidden file.
    Directory  16   Folder or directory.

    Following are not supported:
    System      4   System file.
    Volume      8   Disk drive volume label.
    Archive    32   File has changed since last backup.
    Alias      64   Link or shortcut.
    Compressed 128  Compressed file.
Throws:
IOException

getAttr

public static int getAttr(String pathName)
                   throws IOException
Throws:
IOException

readString

public static String readString(RandomAccessFile file,
                                int nChars)
                         throws IOException
Throws:
IOException

openFile

public static RandomAccessFile openFile(String fileName,
                                        String openMode)
                                 throws IOException
Parameters:
openMode -
      r  Open a file for reading only. You can't write to this file.
      rw Open a file for writing.
Throws:
IOException

openFile

public static RandomAccessFile openFile(String fileName,
                                        int openMode)
                                 throws IOException
Parameters:
openMode -
      1 Open a file for reading only. You can't write to this file.
      2 Open a file for writing.
      8 Open a file and write to the end of the file.
Throws:
IOException

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.