checking removable drives

Richard Gaskin ambassador at fourthworld.com
Thu Nov 3 16:38:45 EST 2005


Chipp Walters wrote:
> Hmm,
> I'm probably just coming late to the party.
> 
> But, you say:
> "If an app can't write to its own directory, it must be installed on the 
> hard drive and not running from a removable device." <-- TRUE (unless 
> it's on a CD-ROM or the removable device is LOCKED)
> 
> of course the inverse isn't true:
> 
> "If an app can write to it's own directory, it must be running from a 
> removable device." <-- NOT TRUE
> 
> and I thought you wanted:
> 
> "I'd like to be able to determine if an app is running from a removable 
> drive."
> 
> Two different matters, I think. But, I'm sure I'm missing something.

Just a couple of posts which led to the mismatch between the thread name 
and the current goal/possible solution. :)

Given that it seems to require an external and/or too much processing 
time to find out if the drive is removable, one solution proposed by 
Bill Vlahos and Paul Looney was to explore the possibility of making the 
app behaved as self-contained as it can anywhere it's run, using the 
OS-mandated folders only when necessary.

This approach takes care of apps running from removable drives, and 
still accomodates apps running from CDs or installed on a system where 
the app can't write to is own folder.

The only downside to self-contained apps is that there's no file-type 
association present in the host system's registry, so documents must be 
opened from within the app rather than double-clicked.  But this factor 
is independent of any method used to determine what type of drive it's 
one; it's just an inherent part of being a portable app.

I know this approach won't win any friends at either Apple or Microsoft, 
since both prefer to dictate where we put files.  But aside from being 
non-conformant, it would seem harmless and carries some benefit for the 
user by allowing the same app to run well with the smallest footprint 
possible on any machine it's run on - it would behave well when run from 
a hard drive and be completely portable on removable drive.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list