Fixed the error code returned when opening a file.#11
Fixed the error code returned when opening a file.#11nanshiki wants to merge 1 commit intojrohel:mainfrom
Conversation
Thank you very much for the PR. While writing code, I was thinking about which error code to return. I tried running a C program. However, if I perform the same test in the Command Prompt on Windows XP: So I’m not sure which error code is more appropriate: DOS_EXTERR_FILE_NOT_FOUND or DOS_EXTERR_ACCESS_DENIED. However, I suppose that the netmount client will run on old DOS (not on Windows XP), so I prefer the old DOS behavior. The fact is, I have not tested other DOSes (MS-DOS, DR-DOS, etc.) to see how they behave (which error code they return) when trying to open a directory as a file on a local disk. |
|
When I try this on MS-DOS/PC DOS, I get Also, if the error code for a non-existent file is incorrect, it will actually cause problems in the application and need to be fixed. |
|
In FreeDOS 1.4, I opened a directory with int 21h ah=3dh and checked the error code, which was 5. |
|
I just tried it with DR-DOS 7.03 since I have it available. On a native system, it returns: C:>type drdos But in Dosemu2 it returns: C:>type drdos But when booting Dosemu2 from a floppy or hard drive image instead of an emulated file system, then it returns: C:>type drdos There might be an issue with the emulated file system of Dosemu. (drdos is the DR-DOS installation directory, of course it exists on all installations) |
|
@nanshiki To keep the code formatting consistent, I use Since the project consists of multiple parts, I use the |
|
You fix it. |
Thank you for the PR and the tests. I’ve started extending netmount-server with support for Note: I still need to determine which error should be returned when a write is attempted while the disk is shared read-only - |
|
Maybe it's helpful how a write-protected floppy disk and CD-ROM behaves on a native DR-DOS 7.03 system: Floppy disk: CD-ROM with NWCDEX 2.81: Unfortunately, the same CD-ROM with SHSUCDX 3.09 behaves differently: |
|
I created a test program that calls DOS file services (INT 21h) and prints the results. I am testing various scenarios on the local filesystem and on the NetMount drive under different DOS versions. Based on the results, I am preparing fixes and adjustments. Therefore, the next version of NetMount will include multiple changes. |
The error code returned when opening a file if the file did not exist was DOS_EXTERR_ACCESS_DENIED. The correct error code is DOS_EXTERR_FILE_NOT_FOUND.
The error code returned when a directory or volume label was specified when opening a file was DOS_EXTERR_FILE_NOT_FOUND. The correct error code is DOS_EXTERR_ACCESS_DENIED.