EternalLines.com: Components: File System: Documentation 

TelFileSystem Component interface


File system operations

    procedure Format (Password, Encryption)

              Format prepares the ELFS file for initial use.
              It need only be called once on a new ELFS file.
              A password and encryption type can optionally be
              supplied.  Encryption can be fseNone or fseCast256.

    procedure Open (Password)

              Open must be called on a formatted ELFS file before any
              other operations can be done.

    procedure Close

              Call Close to gracefully close the ELFS file. This ensures
              that all buffers are flushed and resources are released.


File system properties

    property  Options

              fsoAutoGrow - (Default) If this option is set, the ELFS file
              is automatically enlarged to accomodate file data.

    property  PathSeparator

              PathSeperator is the character used to delimit directory
              names.  The default value is '/'.

    property  MaxSize

              Maximum ELFS file size in bytes.  If MaxSize = 0 there is
              no limit on the ELFS file size.

    property  FileName

              File path (on the host system) to the ELFS file.

    property  FileOptions

              ffsoCreateFileIfNotExist - (Default) This flag enables
              the automatic creation of a new ELFS file on the host
              system when the component is opened and the file does not
              yet exist.

              ffsoAutoFormatNew - (Default) This flag enables the
              automatic formatting of new ELFS files when they are
              created.

    property  InitialSizeKb

              Initial size for the newly formatted ELFS file.

    property  IsOpen

              Read/Write.  True if the ELFS file is open.

    property  FileSystemName
    property  UserData

    property  Size

              Read/Write.  Current size in bytes of the ELFS file.


File system events

    property  OnWarning
    property  OnGetPassword
    property  OnBeforeOpen
    property  OnOpen
    property  OnBeforeClose
    property  OnClose
    property  OnGrow
    property  OnFormatComplete


File operations

    function  FileExists (FileName)

              Returns True if FileName exists.

    function  GetFileFlags (FileName)
    procedure SetFileFlags (FileName, Flags);

    function  GetFileSize (FileName)

              Returns the size of FileName.

    function  GetFileCreateTime (FileName)
    function  GetFileAccessTime (FileName)
    function  GetFileModifyTime (FileName)
    function  GetFileGUID (FileName)
    procedure GetFileContentType (FileName; var ContentType);
    procedure SetFileContentType (FileName, ContentType);

    function  FindFirst (Path, Mask, AttrMask, ReqAttr) : TFSIterator;

              Returns an iterator (caller must free) of all files and
              directories under Path, matching Mask.

    function  OpenFile (FileName, OpenMode) : TFSOpenFile;
    function  OpenFileStream (FileName, OpenMode) : TFSFileStream;

              OpenFile returns an object (TFSOpenFile or TFSFileStream)
              representing the open file.

    procedure DeleteFile (FileName);
    procedure RenameFile (FileName, Name);


Directory operations

    procedure MakeDirectory (Directory);
    procedure RemoveDirectory (Directory);
    function  DirectoryExists (Directory)
    procedure RenameDirectory (Directory, Name);

    procedure EnsurePathExists (Directory);

              EnsurePathExists creates all levels of the path specified
              by Directory.


Events

    property  OnBeforeFileDelete
    property  OnFileDelete
    property  OnFileOpen
    property  OnDirectoryMake
    property  OnBeforeDirectoryRemove
    property  OnDirectoryRemove