Home | Chi sono | Contattami
 

Progr. lineare

Delphi
 
Componenti
  Database
 
Miei articoli

Windows

Miei articoli 

 

File System Virtuale con SDFS


In molti applicativi viene fatto uso di un Virtual File System: comodi, comodi, non c' bisogno di buttarsi in ricerche dettagliate, si tratta semplicemente di un file che al suo interno contiene un insieme di file organizzati proprio nella stessa maniera in cui sono organizzati i comuni file ossia struttura ad albero. Un file che contiene al suo interno altri file? Beh si, pensiamo ad esempio agli archivi tar o gli stessi rar o zip: includono file, alberi di file ... E TrueCrypt o gli altri software di encryption che ci consentono di creare dei volumi criptati? Stessa identica cosa. Tra l'immensa mole di materiale OpenSource Delphi oriented, vi anche una libreria di classi (no package, no install, semplice inclusione della cartella nel Library Path) che si occupa appunto di gestire con diverse utili funzioni un file che contiene al suo interno un intero sistema di file. La libreria di classi in questione si chiama SDFS ossia (S)ingle (F)ile (D)ata (S)torage:

http://www.torry.net/authorsmore.php?id=5967

 

Di seguito le varie features:

Single File Data Storage v.1.4.1 - 467 k 14 Aug 2007

By Alexandru Murariu. The Single File Data Storage library provides an efficient solution for an application to store many different types of data inside one file and to be able to access this data very fast and easily, without bothering about creating temporary files or streams; when requesting to read, the compressed data is decompressed on the fly directly from the source stream.

Look at the samples and in the help file to see how easy it is to use SFDS.

Features:

  • Single-file Virtual File System (read-only): SFDS files are ZIP like archive files (not really ZIP files) with enhanced functionality (see below). One or more SFDS files can be "mounted" in the application. Searching or requesting to open a stream for read will query all "mounted" files or you can just specify a single one.
  • Transparent streaming compression/decompression with full TStream compatibility.
  • Thread-safe (When reading from files): Read from multiple streams (located in the same SFDS file archive) at the same time (Just create a new clone of the stream in each thread - see demo).
  • High performance: SFDS is perfect for Games(and other applications such as backup, etc) which need to store many (ussualy small) files in just a small number of (big) archives. Storing data in a small number of SFDS files results in faster access time to data (When opening a SFDS file the list of streams inside is cached in memory), and also makes it harder to modify files inside.
  • Large file support (64-bit size) lets you store all the data you need in SFDS files of virtually unlimited size.
  • Supported compression types: none (stored), zlib, bzip2. New formats can easily be added.
  • Compression support is modular. Each application can chose to add only the compression it needs (if you need zlib compression/decompression simply add sfds_compressorzlib to the uses clause somewhere inside your project; add sfds_compressorbzip2 for BZip2).
  • Per stream compression option; store one stream uncompressed, another compressed with zlib, another with bzip2, etc.
  • No DLLs required.
  • No file name restrictions (including unicode file names allowed - strings are stored UTF-8 encoded, just like in .dfm files). If the file name is an empty string, then you can still access the data via file index.
  • Reading from compressed streams is just like reading from any other stream (even full seeking in any direction is allowed).
  • You can create links to streams inside SFDS files (the new entries will point to the same data).
  • Includes a list of opened reader objects, which are automatically destroyed if you forget about them (you only need to free the streams you open).
  • It has lots of routines for adding/extracting, testing (MD5 error checking) files to/from the SFDS file format.
  • It also has search routines, to easily find files inside SFDS archives (SFDS_FindFirst, SFDS_FindNext, SFDS_FindClose).
  • Supports metadata information: you can set any fields: string, number, date, boolean, binary (Metadata Editor Form included).
  • You can write/read SFDS files directly to/from any data source. Already implemented: Disk File [R/W], Memory Stream [R/W], Resource Stream [R]. Make a descendent of TSFDSCustomReader to read from any other custom source and a descendent of TSFDSCustomWriter to write to any other custom source. Once written, a SFDS file cannot have more data appended to it.
  • There are no components to install, so this library also works with the free Turbo Delphi.
  • Best of all: it's completely free (Even for commercial use).

La libreria include un dfm (sfds_props.dfm) che contiene le classiche properties (ExplicitLeft, Explicit....) tipiche di Delphi superiore a 7: non un dramma in quanto basta aprire il .pas associato (sfds_props.pas) e clickare su Ignore fino a quando non la smette di rompere il c****; alla fine si salva e taac che funzia tutto anche su Delphi 7. In ogni caso ho fatto un Local Mirror buono appunto per Delphi 7

SingleFileDataStorage.7z

 

 

 

 

 
 
Your Ad Here