Skip to content

Conversation

@andrewbird
Copy link
Contributor

When doing DIR NUL findfirst will actually return success with an attribute indicating a device exists with that name. MS-DOS shows 'File not found' in this case, but FreeCOM (and also Comcom64) can display invalid data, so let's correct that. Since the required constant FA_DEVICE isn't always present in dos.h, let's define it when necessary.

[#181]

Before (C: is MFS, D: is FAT16):

C:\>dir nul
 Volume in drive C is IR DXXXXS C
 Directory of C:\

NUL                      0  10-30-25  6:55p
         1 file(s)              0 bytes
         0 dir(s)     49,839 Mega bytes free
C:\>d:

D:\>dir nul
 Volume in drive D has no label
 Volume Serial Number is 4A09-DBB4

 Directory of D:\

NUL                      0  10-30-25  6:55p
         1 file(s)              0 bytes
         0 dir(s)      42,698,752 bytes free

With patch (C: is MFS, D: is FAT16):

C:\>dir nul
 Volume in drive C is IR DXXXXS C
 Directory of C:\

File not found.

C:\>d:

D:\>dir nul
 Volume in drive D has no label
 Volume Serial Number is 4A09-DBB4
 Directory of D:\

File not found.

When doing `DIR NUL` findfirst will actually return success
with an attribute indicating a device exists with that name.
MS-DOS shows 'File not found' in this case, but FreeCOM
(and also Comcom64) can display invalid data, so let's
correct that. Since the required constant FA_DEVICE isn't
always present in `dos.h`, let's define it when necessary.

[FDOS#181]

Before (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
 Volume in drive C is IR DXXXXS C
 Directory of C:\

NUL                      0  10-30-25  6:55p
         1 file(s)              0 bytes
         0 dir(s)     49,839 Mega bytes free
C:\>d:

D:\>dir nul
 Volume in drive D has no label
 Volume Serial Number is 4A09-DBB4

 Directory of D:\

NUL                      0  10-30-25  6:55p
         1 file(s)              0 bytes
         0 dir(s)      42,698,752 bytes free
~~~

With patch (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
 Volume in drive C is IR DXXXXS C
 Directory of C:\

File not found.

C:\>d:

D:\>dir nul
 Volume in drive D has no label
 Volume Serial Number is 4A09-DBB4
 Directory of D:\

File not found.
~~~
@PerditionC PerditionC merged commit ec6c63f into FDOS:master Oct 30, 2025
6 checks passed
@andrewbird andrewbird deleted the dir-02 branch October 30, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants