SunQuest
           C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 8th, 2008, 10:06 AM
CiaranB CiaranB is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 8 CiaranB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 22 sec
Reputation Power: 0
Sequential and binary files

Can anyone explain the difference in the processing required to update a record in a sequential text file and a random access binary file. Any example would be welcome.
Thanks

Reply With Quote
  #2  
Old May 8th, 2008, 10:20 AM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 2,374 clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level)clifford User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 23 h 55 m 11 sec
Reputation Power: 306
Without any context, your question is ambiguous. But I imagine that sequentially it is expected that each modification requires the entire file to be rewritten, whereas with random access, the record can be modified in-place.

For random access to to work, each record must be of a known and identical size. or have some sort of index or directory.

An easy way to implement random access files is to use memory mapped files. Memory mapped file implementation is platform specific and relies on virtual memory support from the OS and CPU.

Clifford

Reply With Quote
  #3  
Old May 8th, 2008, 10:43 AM
CiaranB CiaranB is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 8 CiaranB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 22 sec
Reputation Power: 0
Quote:
Originally Posted by clifford
Without any context, your question is ambiguous. But I imagine that sequentially it is expected that each modification requires the entire file to be rewritten, whereas with random access, the record can be modified in-place.

For random access to to work, each record must be of a known and identical size. or have some sort of index or directory.

An easy way to implement random access files is to use memory mapped files. Memory mapped file implementation is platform specific and relies on virtual memory support from the OS and CPU.

Clifford



thanks for the help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Sequential and binary files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway