[Lazarus] Unknown error codes.

Rik van Kekem rik at graficalc.nl
Tue May 1 10:48:31 CEST 2018


On 29-04-2018 23:55, Carlos E. R. via Lazarus wrote:
> It does not list the error 26 I got.
> It is possible that there are different numbers on different operating
> systems? That list seems to be related to Windows, but the link does not
> say.
>
It's always possible to get the text of an OS error via SysErrorMessage().

Also note that the EInOutError codes in the range 0-99 represent OS 
error conditions, which are different for Windows and Linux. At least in 
Delphi they do.

On Linux Showmessage(SysErrorMessage(26)) gives us:
Text (code segment) file busy

On Windows it gives:
The specified disk or diskette cannot be accessed.

Of course a program can generate an runtime error itself via Error(Code) 
in which case the code didn't come from the OS and it might mean 
something different.

Small test-program will give you a list:
var
   I: Integer;
begin
   for I := 0 to 99 do
   begin
     Memo1.Lines.Add(Format('%d - %s', [I, SysErrorMessage(I)]));
   end;

On Windows it gives:
0 - The operation completed successfully.
1 - Incorrect function.
2 - The system cannot find the file specified.
3 - The system cannot find the path specified.
4 - The system cannot open the file.
5 - Access is denied.
6 - The handle is invalid.
7 - The storage control blocks were destroyed.
8 - Not enough storage is available to process this command.
9 - The storage control block address is invalid.
10 - The environment is incorrect.
11 - An attempt was made to load a program with an incorrect format.
12 - The access code is invalid.
13 - The data is invalid.
14 - Not enough storage is available to complete this operation.
15 - The system cannot find the drive specified.
16 - The directory cannot be removed.
17 - The system cannot move the file to a different disk drive.
18 - There are no more files.
19 - The media is write protected.
20 - The system cannot find the device specified.
21 - The device is not ready.
22 - The device does not recognize the command.
23 - Data error (cyclic redundancy check).
24 - The program issued a command but the command length is incorrect.
25 - The drive cannot locate a specific area or track on the disk.
26 - The specified disk or diskette cannot be accessed.
27 - The drive cannot find the sector requested.
28 - The printer is out of paper.
29 - The system cannot write to the specified device.
30 - The system cannot read from the specified device.
31 - A device attached to the system is not functioning.
32 - The process cannot access the file because it is being used by 
another process.
33 - The process cannot access the file because another process has 
locked a portion of the file.
34 -
35 -
36 - Too many files opened for sharing.
37 -
38 - Reached the end of the file.
39 - The disk is full.
40 -
41 -
42 -
43 -
44 -
45 -
46 -
47 -
48 -
49 -
50 - The request is not supported.
51 - Windows cannot find the network path. Verify that the network path 
is correct and the destination computer is not busy or turned off. If 
Windows still cannot find the network path, contact your network 
administrator.
52 - You were not connected because a duplicate name exists on the 
network. If joining a domain, go to System in Control Panel to change 
the computer name and try again. If joining a workgroup, choose another 
workgroup name.
53 - The network path was not found.
54 - The network is busy.
55 - The specified network resource or device is no longer available.
56 - The network BIOS command limit has been reached.
57 - A network adapter hardware error occurred.
58 - The specified server cannot perform the requested operation.
59 - An unexpected network error occurred.
60 - The remote adapter is not compatible.
61 - The printer queue is full.
62 - Space to store the file waiting to be printed is not available on 
the server.
63 - Your file waiting to be printed was deleted.
64 - The specified network name is no longer available.
65 - Network access is denied.
66 - The network resource type is not correct.
67 - The network name cannot be found.
68 - The name limit for the local computer network adapter card was 
exceeded.
69 - The network BIOS session limit was exceeded.
70 - The remote server has been paused or is in the process of being 
started.
71 - No more connections can be made to this remote computer at this 
time because there are already as many connections as the computer can 
accept.
72 - The specified printer or disk device has been paused.
73 -
74 -
75 -
76 -
77 -
78 -
79 -
80 - The file exists.
81 -
82 - The directory or file cannot be created.
83 - Fail on INT 24.
84 - Storage to process this request is not available.
85 - The local device name is already in use.
86 - The specified network password is not correct.
87 - The parameter is incorrect.
88 - A write fault occurred on the network.
89 - The system cannot start another process at this time.
90 -
91 -
92 -
93 -
94 -
95 -
96 -
97 -
98 -
99 -

On Linux it gives:
0 - Success
1 - Operation not permitted
2 - No such file or directory
3 - No such process
4 - Interrupted system call
5 - I/O error
6 - No such device or address
7 - Arg list too long
8 - Exec format error
9 - Bad file number
10 - No child processes
11 - Try again
12 - Out of memory
13 - Permission denied
14 - Bad address
15 - Block device required
16 - Device or resource busy
17 - File exists
18 - Cross-device link
19 - No such device
20 - Not a directory
21 - Is a directory
22 - Invalid argument
23 - File table overflow
24 - Too many open files
25 - Not a typewriter
26 - Text (code segment) file busy
27 - File too large
28 - No space left on device
29 - Illegal seek
30 - Read-only file system
31 - Too many links
32 - Broken pipe
33 - Math argument out of domain of func
34 - Math result not representable
35 - Resource deadlock would occur
36 - File name too long
37 - No record locks available
38 - Function not implemented
39 - Directory not empty
40 - Too many symbolic links encountered
41 - Operation would block
42 - No message of desired type
43 - Identifier removed
44 - Channel number out of range
45 - Level 2 not synchronized
46 - Level 3 halted
47 - Level 3 reset
48 - Link number out of range
49 - Protocol driver not attached
50 - No CSI structure available
51 - Level 2 halted
52 - Invalid exchange
53 - Invalid request descriptor
54 - Exchange full
55 - No anode
56 - Invalid request code
57 - Invalid slot
58 - File locking deadlock error
59 - Bad font file format
60 - Device not a stream
61 - No data available
62 - Timer expired
63 - Out of streams resources
64 - Machine is not on the network
65 - Package not installed
66 - Object is remote
67 - Link has been severed
68 - Advertise error
69 - Srmount error
70 - Communication error on send
71 - Protocol error
72 - Multihop attempted
73 - RFS specific error
74 - Not a data message
75 - Value too large for defined data type
76 - Name not unique on network
77 - File descriptor in bad state
78 - Remote address changed
79 - Can not access a needed shared library
80 - Accessing a corrupted shared library
81 - .lib section in a.out corrupted
82 - Attempting to link in too many shared libraries
83 - Cannot exec a shared library directly
84 - Illegal byte sequence
85 - Interrupted system call should be restarted
86 - Streams pipe error
87 - Too many users
88 - Socket operation on non-socket
89 - Destination address required
90 - Message too long
91 - Protocol wrong type for socket
92 - Protocol not available
93 - Protocol not supported
94 - Socket type not supported
95 - Operation not supported on transport endpoint
96 - Protocol family not supported
97 - Address family not supported by protocol
98 - Address already in use
99 - Cannot assign requested address

So, because of the differences in Windows and Linux it might be best to 
always show the SysErrorMessage(code) too (if it is indeed an OS error). 
It will generate a much clearer message.

/Rik/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180501/9bd99db7/attachment.html>


More information about the Lazarus mailing list