home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / cbm / 5195 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.2 KB  |  48 lines

  1. Newsgroups: comp.sys.cbm
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!wupost!csus.edu!netcom.com!fuzzy
  3. From: fuzzy@netcom.com (Fuzzy Fox)
  4. Subject: Re: RELative files on the 1541
  5. Message-ID: <1992Dec23.065436.17287@netcom.com>
  6. Organization: Foxes 'R' Us - Seven locations to serve you
  7. References: <1h0sfuINNjjo@uniwa.uwa.edu.au>
  8. Date: Wed, 23 Dec 1992 06:54:36 GMT
  9. Lines: 37
  10.  
  11. peterb@gu.uwa.edu.au (Peter Broadribb) writes:
  12.  
  13. >I'm having a problem with relative files.  Sometimes the end of a record
  14. >in the rel file doesn't get written on to the disk so when it's read
  15. >back the drive reads the beginning of the next file too.  It happens
  16. >with large records.  Does anyone have a solution?
  17.  
  18. REL files have had bugs in their implementation since the original CBM
  19. DOS that supported them.  Even today no one is completely sure if they
  20. work properly in all cases.
  21.  
  22. Many of the bugs surround the positioning in the file.  You can avoid a
  23. lot of problems by doing these things:
  24.  
  25. 1.  Give the position command TWICE every time you use it.  Jim
  26. Butterfield recommends giving the command once, then wait a short time,
  27. then give it again.  A "short time" is about 1/20 second or so.
  28.  
  29. 2.  Use record lengths that are divisible into 254.  This means use a
  30. record length 2, 127, or 254 for the records in your file.  If you do
  31. this you should avoid nearly all bugs, because most of them have to do
  32. with records that span multiple sectors.  If you use 2, 127, or 254 byte
  33. records, they will never span multiple sectors.  This might be wasteful
  34. of disk space, but it might be worth it for reliability.
  35.  
  36. Another idea is the do-it-yourself approach.  Scrap REL files and do
  37. direct T/S allocations and manipulations.  Nearly all commercial
  38. programs work in this fashion when random access is needed.  It does tie
  39. your program to specific disk architecture in most cases, but apparently
  40. that's not a big deal, because everyone has a 1541.  You may get some
  41. 1581 user complaints though.  :)
  42.  
  43. -- 
  44. #ifdef TRUE         | Fuzzy Fox                  fuzzy@netcom.com
  45. #define  TRUE   0   | a.k.a. David DeSimone      an207@cleveland.freenet.edu
  46. #define  FALSE  1   | "You have been recruited by the Star League to defend
  47. #endif              |    the Frontier against Xur and the Kodan Armada."
  48.