Date: Thu, 25 Jan 1996 20:13:29 CST (-0600) To: djgpp AT delorie DOT com From: cameronbuschardt Subject: Re: V2 alpha 960124 >Date: Thu, 25 Jan 1996 15:18:52 >To: Eli Zaretskii >From: cameronbuschardt >Subject: Re: V2 alpha 960124 > >At 06:16 PM 1/25/96 +0200, you wrote: >> >>On Thu, 25 Jan 1996, DJ Delorie wrote: >> >>> Hmmm.. I think my subconsious is trying to program also. I feel that >>> access() is used enough during startup to try to avoid keeping >>> findfirst from linking in. stat() handles root directories already; >>> can we switch opendir back to the old way (call findfirst) rather than >>> call access? >> >>If you don't disable filename globbing, `findfirst' is called during >>startup anyway (by `fnmatch'), isn't it? >> >>`opendir' can indeed be fixed by restoring the old code (unless you had >>good reasons to change it), but I don't think we can live with `access' >>which fails on some root directories. For instance, Emacs calls `access' >>to see whether a directory exists (is readable) before running Dired on >>it. >> >>The real problem is that `access' calls `_chmod', which isn't guaranteed >>to work on root directories because they aren't true files. Is there >>another, cheaper way to detect a root directory of a valid drive? >> >>If this problem is limited to CD-ROM drives (I didn't see it with any >>other drives--Novell, NFS, RAM etc.), then a small function >>`is_cdrom_drive' from src/libc/compat/mntent/mntent.c might be all we >>need. Can other people test `access' with all the network drives you can >>reach and verify that this problem is limted to CD-ROM? > >There are 3 possibilies to detect if a drive is valid. >1. Record waht the current drive is, then switch to the drive in question. > Next check to see if there were any errors if not then switch back to the > original drive. > >2.) Use Int 21h, Ah=247h (Get current dir on specified drive. > where: > DS:SI points to 64 byte buffer (for dir) > DL=drive number (0=a 1=b..) (Note 2 is not drive C) > Return: > Carry flag set if error > ah=15 if INVALID drive specification. > >3.) Use BIOS. >There is probably another way but these are the only ones I know of. >