Solid File System

Virtual file system enigne that can be embedded into your software.

SolFSStream constructor

Filter:

Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStream     See also    

Overview

Creates a new file in the storage or opens existing one.

Declaration

[Pascal]
    constructor Create(Storage: TSolFSStorage; FileName: TSolFSString; CreateNew, ReadEnabled, WriteEnabled, ShareDenyRead, ShareDenyWrite: Boolean; Password: String=''; Encryption: TSolFSEncryption=ecNoEncryption; Reserved : Integer = 0; Compression: TSolFSCompression; CompressionLevel : LongWord; PagesPerCluster : LongWord; );

[Plain C]
    long _stdcall StorageCreateFile(unsigned long Storage, const wchar_t* FileName, char ReadEnabled, char WriteEnabled, char ShareDenyRead, char ShareDenyWrite, unsigned long Encryption, wchar_t* Password, unsigned long PasswordLen, unsigned long* File, bool OpenExisting, bool TruncateExisting);

    long _stdcall StorageOpenFile(unsigned long Storage, const wchar_t* FileName, char ReadEnabled, char WriteEnabled, char ShareDenyRead, char ShareDenyWrite, wchar_t* Password, unsigned long PasswordLen, unsigned long* File);

    long _stdcall StorageCreateFileCompressed(unsigned long Storage, const wchar_t* FileName, char ReadEnabled, char WriteEnabled, char ShareDenyRead, char ShareDenyWrite, unsigned long Encryption, wchar_t* Password, unsigned long PasswordLen, unsigned long* File, unsigned long Compression, unsigned long CompressionLevel, unsigned long PagesPerCluster, bool OpenExisting, bool TruncateExisting);

[C++ (DLL/Lib)]
    SolFSStream(SolFSStorage *storage, unsigned short * FileName, bool createNew, bool readEnabled, bool writeEnabled, bool shareDenyRead, bool shareDenyWrite, String* password, SolFSEncryption Encryption, long Reserved)

    SolFSStream(SolFSStorage *storage, unsigned short *FileName, bool CreateNew, bool ReadEnabled, bool WriteEnabled, bool ShareDenyRead, bool ShareDenyWrite, unsigned short * Password, SolFSEncryption Encryption, long Reserved, SolFSCompression Compression, unsigned long CompressionLevel, unsigned long PagesPerCluster )

    SolFSStream(SolFSStorage *storage, unsigned short * FileName, unsigned short * mode)

[C++ (VCL)]
    TSolFSStream(TSolFSStorage* Storage, TSolFSString FileName, bool CreateNew, bool ReadEnabled, bool WriteEnabled, bool ShareDenyRead, bool ShareDenyWrite, AnsiString Password, TSolFSEncryption Encryption, unsigned long reserved, TSolFSCompression Compression, unsigned long CompressionLevel, unsigned long PagesPerCluster );

[C++ (.NET)]
    SolFSStream(SolFSStorage *storage, String* fileName, bool createNew, bool readEnabled, bool writeEnabled, bool shareDenyRead, bool shareDenyWrite, String* password, int encryption, long reserved)

    SolFSStream(SolFSStorage *storage, String* fileName, bool createNew, bool readEnabled, bool writeEnabled, bool shareDenyRead, bool shareDenyWrite, String* password, SolFSEncryption encryption, long reserved, SolFSCompression Compression, unsigned long CompressionLevel, unsigned long PagesPerCluster )

    SolFSStream(SolFSStorage *storage, String* fileName)

[C#]
    SolFSStream(SolFS.SolFSStorage storage, String fileName, bool createNew, bool readEnabled, bool writeEnabled, bool shareDenyRead, bool shareDenyWrite, String password, SolFSEncryption encryption, long reserved)

    SolFSStream(SolFS.SolFSStorage storage, String fileName, bool createNew, bool readEnabled, bool writeEnabled, bool shareDenyRead, bool shareDenyWrite, String password, SolFSEncryption encryption, long reserved, SolFSCompression Compression, uint CompressionLevel, uint PagesPerCluster )

    SolFSStream(SolFS.SolFSStorage storage, String fileName);

[VB.NET]
    SolFSStream(storage As SolFS.SolFSStorage, fileName As String, createNew As Boolean, readEnabled As Boolean, writeEnabled As Boolean, shareDenyRead As Boolean, shareDenyWrite As Boolean, password As String, encryption As SolFSEncryption, reserved As Long)

    SolFSStream(storage As SolFS.SolFSStorage, fileName As String, ByVal createNew As Boolean, readEnabled As Boolean, writeEnabled As Boolean, ByVal shareDenyRead As Boolean, shareDenyWrite As Boolean, password As String, ByVal encryption As SolFSEncryption, reserved As Long, ByVal Compression As SolFSCompression, ByVal CompressionLevel As UInt32, ByVal PagesPerCluster As UInt32)

    SolFSStream(storage As SolFS.SolFSStorage, fileName As String)

[Java]
    SolFSStream( SolFSStorage storage, String fileName, String fileMode )

    SolFSStream(SolFS.SolFSStorage storage, String fileName, boolean createNew, boolean readEnabled, boolean writeEnabled, boolean shareDenyRead, boolean shareDenyWrite, String password, SolFSEncryption encryption, long reserved, SolFSCompression compression, long compressionLevel, long pagesPerCluster )

Parameters

  • Storage - specifies the storage in which the file is to be created or opened.
  • FileName - the full name of the file (including complete path) which is to be created or opened.
  • CreateNew - set this parameter to True if new stream must be created and as False if existent one will be used.
  • ReadEnabled - use this parameter to show if reading from the opened file is enabled.
  • WriteEnabled - use this parameter to show if writing to the opened file is enabled.
  • ShareDenyRead - indicates if reading from the file opened by another user is enabled.
  • ShareDenyWrite - indicates if writing to the file opened by another user is enabled.
  • Password - is used if file is encrypted and needs password to be read from or writen to.
  • Encryption - shows what method of encryption is used for the file. Encryption is not supported in evaluation version.
  • Reserved - reserved for future use.
  • Compression - use this parameter to set compression mode for the file.
  • CompressionLevel - compression level. Level value of 0 means "default" value. Other values depend on compression method. For ZLib the values are 1 (faster, less effective) to 9 (slower, most effective).
  • PagesPerCluster - the number of pages compressed as a single entity.
  • [Plain C] File - returns handle to the created file.
  • [Plain C] OpenExisting - When OpenExisting is false, only new file can be created. If the file exists, it won't be opened.
  • [Plain C] TruncateExisting - When TruncateExisting is true and the file exists, it is truncated (size set to 0).
    When TruncateExisting is false and file exists, it's size and contents are not changed.
  • [C++ (DLL/Lib)] Mode - Specifies open/create mode in C style (used in fopen() RTL function)
  • [Java] fileMode - Specifies open/create mode in C style (used in fopen() RTL function)

Values of SolFSEncryption

Values of SolFSCompression

Values of OpenMode, FileMode

Description

Use this method to create a new file in SolFSStorage or open existing file. For constructors, that don't include compression and encryption parameters, FilesEncryption and Compression* properties of SolFSStorage are used.

[Plain C]  

StorageCreateFile and StorageCreateFileCompressed always open file, i.e. they either create new file or open existing file. StorageOpenFile, on the other hand, only opens existing files and files if the file doesn't exist.

[Plain C]  Return values

0 if the function succeeded or one of Error codes if the function failed.

See also

SolFSStorage class     SolFSStream class     Compression     CompressionLevel     Encryption     Password    

Back to top