Sunday, August 2, 2009

Need an idea?

i need an idea on how 2create my own file %26amp; directory structure etc for the problem below ,i'm working in Visual studio C#





Implement a Portable File System (PFS). Allocate a file. Move files from the Windows file system into your file. You should have your own directory structure, allocation table, etc. inside your file. Move files back out of your file to the Windows file system.





When your program is running it should somehow accept the following commands:





open PFSfile Allocate a new 10 KByte "PFS" file if it does not


already exist. If it does exist, begin using it for further


commands.


put myfile Copy the Windows file "myfile" into your PFS file.


get myfile Extract file "myfile" from your PFS file and copy it to


the current Windows directory.


rm myfile Delete "myfile" from your PFS file.


dir List the files in your PFS file.


putr myfile "Remarks" Append remarks to the directory entry for myfile in


your PFS file.


kill PFSfile Delete the PFSfile from the Windows file system.


quit Exit PFS.





You can provide those commands either through menus or through buttons on a


form (or both). If the user clicks a button in your application window, it might open up a dialog box to get a filename. Alternatively, you can just open up a text box and let the user key in the name of a file (or whatever other variable information you need.)





Limits:





Filenames are a max. of 20 bytes. The directory need handle only Name, Size, Time and Date. If the original PFS file fills up then you should create a new PFS "volume" with the same name but a different suffix - e.g., pfs.1, pfs.2, etc., each the same size as the first "volume". Your file system should use an allocation scheme where "disk blocks" are 256 bytes each. You should handle unusual conditions such as trying to put a file into the PFS when a file with that name is already there, file too large to fit into one "volume", etc.

Need an idea?
This is similar to a database structure


No comments:

Post a Comment