|
-
April 6th, 1999, 09:38 PM
#1
Drive Information?
After browsing for a file path, I want my app to determine whether or not the drive is read-only (e.g. a CD-ROM drive). Is there an easy way to do this?
-
April 6th, 1999, 10:20 PM
#2
Re: Drive Information?
GetDriveType will tell you some things about the drive (e.g. that it is a CD-ROM). Simply trying to open a file for writing will tell you about whether you can write to the drive (which may be related to whether you've been given right to do so or not rather than anything about the drive itself).
The universe is a figment of its own imagination.
-
April 6th, 1999, 11:34 PM
#3
Re: Drive Information?
Try ::access(fname, mode)
-
April 7th, 1999, 01:06 AM
#4
Re: Drive Information?
Hi.
Try this.
UINT nType = ::GetDriveType((LPCSTR)strDrive);
nType get the following type.
0 -> UnKnown drive type.
1 -> Root directory does not exists.
DRIVE_REMOVABLE -> A DRIVE
DRIVE_FIXED -> HARD DRIVE
DRIVE_REMOTE -> NET WORK DIRVES
DRIVE_CDROM -> CD-ROM DIRVE
DRIVE_RAMDISK -> RAM DRIVE
But this may be a little different from your rquest like read_only.
In addition, now there exists rewritabel CD-ROM.
So, try to save something, and if it get error message, it is read only?
Hope for help.
-Masaaki Onishi-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|