I started to write a module (pure Perl) to implement a virtual disk inside a file. This will be used in other project, much bigger, in the future. But I will put this resource as a Perl module to the others use.

I want to share my ideas, and ask for some, since I saw, in previous postes, that this help a lot, and doesn't hurt.

Is not very simple to make a real virtual disk, that can be changed every time, for many programms in the same time, inside a file. Is not only a database to save files. We need to read, write, delete, move, etc...

Thinking about a good way to do that I first implemented a FAT system inside the file, with clusters. So, all the clusters have the same size, a status, and can be linked to other cluster to make a block. Then I'm creating the block handle, where every block can have some clusters, in any point of the file, and this group of clusters (the block) are used to save data. To save files, or directorys, we can use different types of formats and headers, to than save the data in the block. And finally make the IO::File based on the virtual disk, to can use it directly as a normal perl IO.

The objective of this architecture is make a dynamic and fast way to work with the virtual disk. And the file system will be similar to UNIX, where you can mount a virtual disk in some path, and make the virtual disk use many different files, in different machines.

The objective of this is a full portable way to save files, with security. For example, you can save a file with .exe extension, and don't worry if some one will execute it. Or use files with UNIX path on Mac.

But to make a good format I need to think in all the resources that I need to implement. For example, what stats a file will have, data, size, mode, etc... I can have links inside the disk to another file? If yes, need to think in the format.

Well, this is the list of resources now. If you have some idea, send your comments:

TYPES OF DATA: file, directory, link. STATUS OF A FILE/DIRECTORY/LINK: size The size used by the file. rsize The real size, in clusters, of the file. blocks The number of blocks (clusters) in use. AcTime When the file was last accessed. MdTime When the file was last modified. CrTime When the file was created. mode: rwx (will use x? if I can't run a file!) uid/gid Will have user access level? since we can read the main file disk... Or use just to tell who created it. CRYPTOGRAPHY A file can be encrypted with symmetric and asymmetric keys. What algorithm to use? Alrady exist a Perl module for it?
About the name of the module, how about IO::VirtualDisk?

I will be very glad for any reply.

Graciliano M. P.
"The creativity is the expression of the liberty".


In reply to Virtual Disk for Perl by gmpassos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.