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
File operations : return specific errorcode
Re: File operations : return specific errorcode
They already do(windows version atleast), problem is that the reference manual don't tell you that. So this would work nicely:tomk wrote: 2. read/write return
read/write operations like readdata/writedata,.. should return the length read/written, so validation would be easier.
Code: Select all
length.l = ReadData(*buffer, 1024) ; where 'length' is the actual length that was read
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.
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
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_()
lots of different commands.
Here you can find the meanings of the returned error codes:
http://msdn.microsoft.com/library/defau ... _codes.asp
Timo
quidquid Latine dictum sit altum videtur