Determining type of drive a file is on

Trevor DeVore lists at mangomultimedia.com
Mon Aug 2 18:21:08 EDT 2004


On Aug 2, 2004, at 2:56 PM, kee nethery wrote:
>
> The goal of the OS is to make all drives appear exactly the same, as 
> drives that are either writeable or not and otherwise, the apps 
> running under that OS should not notice any differences between them.
>
> What you are asking for is counter to what the OS is trying to do. 
> Obviously the data is available. You'll note that Apple writes the 
> system profiler and I'd guess that they probably have to modify it on 
> a frequent basis to allow it to use undocumented calls to bypass what 
> the OS is doing and provide you with the data that you desire when you 
> are using system profiler. My guess is that someone else could write a 
> similar piece of software but that they too would be constantly 
> revising the various profiles in their software each time new hardware 
> is released.
>
> If I were you, I'd ask a question that every OS wants to answer rather 
> than trying to ask a question about a detail that every OS tries to 
> hide.
>
> So lets step back. Why are you asking these questions? Perhaps you 
> should instead, allow the user to select the drive they want? Perhaps 
> you can do some educated guessing based upon read write times of a 
> standard size file and based upon the relative size of various drives 
> available to the system? Why do you care what kind of drive? If you 
> are making assumptions about what you can do with a drive based upon 
> what type it is, perhaps you should not do that because chances are 
> good that your assumptions will be wrong for some percentage of your 
> users. If you need to mark a drive, perhaps you let the user mark it 
> by storing a file on it and instead of doing something with the USB 
> flash drive, you do something with the drive that has the marker file?
>
> On my system (a laptop) I have quite a few drives. The internal hard 
> drive 37GB. A disk image that mounts onto the desktop that is actually 
> stored on the laptop drive 500Mb. Two external firewire drives 15GB 
> and 190GB. One USB flash drive 32MB and a disk image on it that is 5MB 
> in size, and a USB digital camera 256MB. One DVD read/write 4GB which 
> can also be a CD R/W. And then at various times a disk image that 
> mirrors a remote FTP site.
>
> Now if I was running your software, I don't think I'd want you to make 
> any assumptions about the various drives on my system. I'd want to 
> specify which drives you write or store onto and which drives you run 
> from. For example, the 190GB is a backup and I don't want you to do 
> anything to that drive even though it appears to be the main drive if 
> you base that decision upon access speed and size.
>
> Not knowing anything about what you are attempting to do, I urge you 
> to consider alternate ways of accomplishing what you are attempting to 
> accomplish that are in sync with what all OSes are trying to do. 
> Trying to go against the OS is never a long term solution.

Thanks for the detailed response.  My reasons for knowing whether the 
drive my app is running off of is USB or some other format is that I am 
looking at different options for some light, non-intrusive, inexpensive 
copy protection for some training materials.  We may be deploying the 
materials on USB drives for some other reasons and if we do we want to 
limit ways in which the app could be copied to a hard disk or burned to 
a CD-ROM.  Right now I'm just looking for what information I will have 
available so I can see what options I have.

Thanks,

-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list