Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Inventory System using Binary Files
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: Wed Nov 16, 2005 9:44 pm   Post subject: Inventory System using Binary Files

Instead of the normal text file where you can use sequential access to read/write information. This is using a binary file, in small scales there's really not alot of difference. But in large scales, I suppose there will be.

For example:
you have
123
1234
12345
12
1234

in a normal file, to get to the last "12" you would have to read through everything above it.

Using a binary file, you can just "seek" to that specific location, provided you know how many bytes the data before it takes up. And that I have done using an array of records, in which the fields have specific size allocations.

Anyhow, 3 files below:
inventory.t - the actual inventory system program
CreateDataFile.t - used to create the binary file
inventorydata.txt - the binary file



inventorydata.txt
 Description:
binary file

Download
 Filename:  inventorydata.txt
 Filesize:  540 Bytes
 Downloaded:  165 Time(s)


CreateDataFile.t
 Description:
used to create data file

Download
 Filename:  CreateDataFile.t
 Filesize:  1.37 KB
 Downloaded:  143 Time(s)


inventory.t
 Description:
main program

Download
 Filename:  inventory.t
 Filesize:  12.13 KB
 Downloaded:  162 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: