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