Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locked removable
Message
From
22/10/2003 08:17:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/10/2003 05:29:00
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00840941
Message ID:
00840972
Views:
23
>Hi All,
>
>how to determine if a (removable)drive is locked (read only)?
>
>TIA
>
>Agnes
local llRW, lnHandle, lcFile
lcFile = sys(2015)+'.tmp'
lnHandle=fcreate(lcFile)
if lnHandle > 0
 fclose(lnHandle)
 erase (lcFile)
 llRW = .t.
else
 if ferror() = 29 && Disk full
 endif
endif
Might be.

or with WSH you might want to check first if drive is ready :
Lparameters tcDriveName
oFS = CREATEOBJECT('Scripting.FileSystemObject')
For each oDrv in oFS.Drives
  If oDrv.DriveLetter = upper(tcDriveName)
    Return oDrv.IsReady
  Endif
Endfor
Return .F.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform