Date : Thu, 11 Nov 2010 22:46:04 +0000
From : jgh@... (J.G.Harston)
Subject: RFC: Need two error numbers
Refering to http://beebwiki.jonripley.com/System_error_messages
and http://beebwiki.jonripley.com/Talk:Error_messages
I need a couple of error numbers for two errors the interface between
PDP BASIC and Unix may generate, Read error and Write error. They would
be generated in the middle of a Load or Save operation respectively.
This is distrinct from an error occuring /before/ starting to load or
save a file - that is already catered for with 192,"Can't save" and
214,"Not found".
In pseudocode, the relevant bits of code are as follows:
load:
fd=fopen(file,in)
if fd=0 error(214,"Not found")
repeat
ok=read(fd,addr,size)
if not ok error(????,"Read error")
until end
close(fd)
save:
fd=fopen(file,out)
if fd=0 error(192,"Can't save")
repeat
ok=read(fd,addr,size)
if not ok error(????,"Write error")
until end
close(fd)
The problem occurs because file read/write is a seperate
and distict operation from finding a file, and there is no
atomic "load/save an entire file" operation. Examining other
code I haven't been able to track down error numbers used
in a similar cases. For example on BBC BASIC for CP/M which
uses the same paradym of open, read/write, close, if an
error occurs in the read/write phase the error 255,"CP/M error"
is generated :(
--
J.G.Harston - jgh@...