Page 1 of 1

File operations : return specific errorcode

Posted: Thu Jul 24, 2003 10:18 am
by tomk
Hi there,

I would love to have 2 things in file opeartions

1. returning defined errorcode
Fileoperations like open/create should return a defined errorvalue if something has gone wrong.
Like in some languages I use I get an :
error 5 : unable to open exclusive
Error 3 : Path not found

2. read/write return
read/write operations like readdata/writedata,.. should return the length read/written, so validation would be easier.

Greetings
tom

Re: File operations : return specific errorcode

Posted: Thu Jul 24, 2003 10:39 am
by Pupil
tomk wrote: 2. read/write return
read/write operations like readdata/writedata,.. should return the length read/written, so validation would be easier.
They already do(windows version atleast), problem is that the reference manual don't tell you that. So this would work nicely:

Code: Select all

length.l = ReadData(*buffer, 1024) ; where 'length' is the actual length that was read

Posted: Thu Jul 24, 2003 11:10 am
by freak
About a specific error code:

On the Windows operating system, you can almost always get a code for
the last occured error, after a function has failed.

Code: Select all

ErrorCode.l = GetLastError_()
As I said, this is an universal function, and can be used after a failure of
lots of different commands.

Here you can find the meanings of the returned error codes:
http://msdn.microsoft.com/library/defau ... _codes.asp

Timo

Posted: Wed Jul 30, 2003 8:20 am
by tomk
Hello ,

thanks for the info, so I have to correct my wish :

I would like to have a better online help :-)

Thanks again
tom