home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!uunet.ca!canrem!dosgate![jonathan.forbes@canrem.com]
- From: "jonathan forbes" <jonathan.forbes@canrem.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: writing odd bytes
- Message-ID: <1992Sep6.848.16300@dosgate>
- Date: 6 Sep 92 02:33:46 EST
- Reply-To: "jonathan forbes" <jonathan.forbes@canrem.com>
- Distribution: comp
- Organization: Canada Remote Systems
- Lines: 37
-
- I have run into a very strange problem. In one of my programs, a
- Write() call will occasionally take *much* longer to execute than it
- should (when writing to any hard drive). When this happens, it would
- seem to be a slowdown to about 25% of "normal" speed, and the hard drive
- activity light is solid.
-
- It's almost as if the data was being written a little bit at a time, but
- I have checked and only large pieces are being written (~= 64k).
-
- Now, the strange thing I noticed eventually is that writing an odd
- number of bytes seems to make it happen; I can write 65534 or 65536
- bytes, but if I write 65535 bytes, it slows down.
-
- Even weirder; I wrote a tiny program to try to test this out (writing
- 65535 bytes ten times to a new file) but it didn't have any effect
- there.
-
- Note that even though it takes 4 times long to write the data, the data
- written *is* correct.
-
- I have *no* idea what could cause this; perhaps it's something internal
- to DOS, and for some reason DOS decided to write out the data in small
- pieces (maybe my program wrote over something critical to cause such a
- thing? but if so, why only for odd byte amounts?)
-
- I also tried making the program write (Size+1) bytes if Size was odd,
- and then doing a Seek() backwards one, but that also incurred the same
- slowdown for some odd reason...
-
- The problem does not occur when I am writing to a RAM: disk, but it
- occurs on all of my hard drives.
-
- Anyone run into this problem before or have *any* light to shed on this
- matter? I'm rather confused...
- --
- Canada Remote Systems - Toronto, Ontario/Detroit, MI
- World's Largest PCBOARD System - 416-629-7000/629-7044
-