Subject: Re: Detecting missing diskette (was Re: tcl/tk devotee needs help) - DN [1]


Alexandre Ferrieux <alexandre.ferrieux@cnet.francetelecom.fr> - 25 Feb 1999 - comp.lang.tcl

 Christopher Nelson wrote:
 >
 > Christopher Nelson wrote:
 > >
 > > Alexandre Ferrieux wrote:
 > > > Now, a related question: how do you check for the presence of a
 > > > removable media (e.g. floppy or CD) on Windows *without* making that
 > > > stupid alert "There is no floppy in dirve A: retry, abort, cancel, eat
 > > > lunch, get lost ?" ?
 > > >
 > > > The reason I'm interested is that I want to look for specific
 > > > directories on *all* network drives of a bunch of Windows PCs which have
 > > > an inconsistent naming (some mount the relevant volume on E:, some on
 > > > F:, etc.). So, I do a foreach on [file volumes], and bump into that
 > > > !@#$% alert for removables...
 > >
 > > I don't know but it's a great question.  I hope someone comes forward with an
 > > answer.  If not, I suggest we need a [file mounted] or something that takes an
 > > element of the return of [file volumes] and lets you know if it's readable.
 > > (BTW, another use for this is network drives.  I have 2 drives on my W98 system
 > > that are always mapped but may not always be available if my PPP link to the
 > > office is down.)
 >
 > On my WNT box, this works:
 >
 >     foreach v [file volumes] {
 >         if {[catch {file stat $v stat}]} {
 >             puts "$v is not mounted or has no diskette in it"
 >         }
 >     }

 Hey ! I've just checked, and [file stat] and [file exist] now both work
 correctly on 8.1 !!!
 Strange I've never seen a mention of that in the "changes" files.
 The closest I can find is in 8.1a1's "changes":

     1/16/98 (os workaround) Under windows, "file volume" was causing
 chatter
     and/or several seconds of hanging when querying empty floppy drives.
     Changed implementation to call an empirically-derived function that
 doesn't
     cause this. (CCS)

 So the truth seems to be that this "empirically-derived function" is
 used to fix *also* [file exists] and [file stat]...

 Anyway, we're still stuck if we can't use 8.1 !

 -Alex

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated