Mail Archives: djgpp/2003/06/25/12:17:54
Andrew wrote:
>>>I noticed that stat treats some character devices differently, depending
>>>on whether it is run in a DOS box under Win98 or in plain DOS. The COM
>>>series (com1, com2, etc.) shows as a character device when run under
>>>plain DOS, but not in the DOS box under Win98.
>>
>>On my Windows 98 box, "ls -l com2" shows "com2" in yellow, which means
>>`stat' did return the character-device bit set for it. So I guess I
>>cannot reproduce this here.
>>
>>
>>>A test program that demonstrates this follows.
>>
>>You didn't show the results of running this program on Windows 98.
>>Here are mine:
>>
>> The value of base is com1
>> The value of st_dev is -1.
>> The value of st_mode is 8612.
>> The file is a character device.
>>
>>Exactly as I'd expect.
>>
>>So I guess more digging is required.
>
> Could the differences be caused by the 2.03 v's 2.04 alpha 1
> differences?
>
> Andrew
I tested it. It doesn't like long file names in the path.
Here's the script I ran with bash:
===== [Start of file 'testdev.sh'] =====
#!/bin/bash
#
devs='con aux prn clock$ com1 com2 com3 com4 lpt1 lpt2 lpt3 config$
xmsxxxx0 $mmxxxx0 setverxx ifs$hlp$ mscd001 dblsysh$'
echo Devices are:
echo
ls $devs
echo
echo
cd /
echo DJGPP CWD=`pwd`
echo Windows CWD=`/command.com /c cd`
ls -l $devs
echo
echo
cd "Program Files"
echo DJGPP CWD=`pwd`
echo Windows CWD=`/command.com /c cd`
ls -l $devs
echo
echo
cd ../progra~1
echo DJGPP CWD=`pwd`
echo Windows CWD=`/command.com /c cd`
ls -l $devs
echo
echo
cd bochs-2.0.2
echo DJGPP CWD=`pwd`
echo Windows CWD=`/command.com /c cd`
ls -l $devs
echo
echo
cd ../bochs-~1.2
echo DJGPP CWD=`pwd`
echo Windows CWD=`/command.com /c cd`
ls -l $devs
===== [End of file 'testdev.sh'] =====
And here's the output from running 'testdev.sh >testdev.txt 2>&1' under
bash.
===== [Start of file 'testdev.txt'] =====
Devices are:
$mmxxxx0
aux
clock$
com1
com2
com3
com4
con
config$
dblsysh$
ifs$hlp$
lpt1
lpt2
lpt3
mscd001
prn
setverxx
xmsxxxx0
DJGPP CWD=c:/
Windows CWD=C:\
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 $mmxxxx0
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 aux
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 clock$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com4
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 con
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 config$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 dblsysh$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 ifs$hlp$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 mscd001
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 prn
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 setverxx
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 xmsxxxx0
DJGPP CWD=c:/Program Files
Windows CWD=C:\Program Files
ls: com1: No such file or directory (ENOENT)
ls: com2: No such file or directory (ENOENT)
ls: com3: No such file or directory (ENOENT)
ls: com4: No such file or directory (ENOENT)
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 $mmxxxx0
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 aux
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 clock$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 con
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 config$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 dblsysh$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 ifs$hlp$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 mscd001
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 prn
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 setverxx
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 xmsxxxx0
DJGPP CWD=c:/progra~1
Windows CWD=C:\Program Files
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 $mmxxxx0
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 aux
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 clock$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com4
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 con
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 config$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 dblsysh$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 ifs$hlp$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 mscd001
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 prn
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 setverxx
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 xmsxxxx0
DJGPP CWD=c:/progra~1/bochs-2.0.2
Windows CWD=C:\Program Files\bochs-2.0.2
ls: com1: No such file or directory (ENOENT)
ls: com2: No such file or directory (ENOENT)
ls: com3: No such file or directory (ENOENT)
ls: com4: No such file or directory (ENOENT)
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 $mmxxxx0
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 aux
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 clock$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 con
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 config$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 dblsysh$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 ifs$hlp$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 mscd001
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 prn
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 setverxx
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 xmsxxxx0
DJGPP CWD=c:/progra~1/bochs-~1.2
Windows CWD=C:\Program Files\bochs-2.0.2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 $mmxxxx0
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 aux
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 clock$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 com4
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 con
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 config$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 dblsysh$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 ifs$hlp$
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt1
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt2
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 lpt3
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 mscd001
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 prn
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 setverxx
crw-r--r-- 1 dosuser dos 0, 0 Jun 26 01:51 xmsxxxx0
===== [End of file 'testdev.txt'] =====
- Raw text -