From: dave on
Define "Removable drive". Have you considered "Removable media"?

Things to consider you haven't mentioned are that eSata drives are not
detectable via any call I am aware of in any version of any OS. Most
motherboards that have a standard SATA connector can be converted with
a simple cable to be eSata. I have noticed that the removable icon in
the system tray lists all SATA and eSata drives.

The ONLY way you can be sure is to place your executable with the one
it services.


On Sat, 17 Apr 2010 14:55:29 -0700 (PDT), Richard Russell
<news(a)rtrussell.co.uk> wrote:

>On Apr 17, 10:15�am, David Lowndes <Dav...(a)example.invalid> wrote:
>> Given that your definition of transient is ambiguous, it'll be
>> difficult to come up with a definitive answer. What is it that you're
>> trying to achieve, maybe there's some other solution?
>
>The scenario is an executable which acts as a plug-in for an
>application; when first executed it 'installs' itself in the
>application (basically by recording its location in the registry). If
>the executable is located on a network or removable drive, or in a
>temporary directory, it must first copy itself to a 'safe' place, but
>otherwise it doesn't bother (to avoid making an unnecessary copy,
>which might require admin privileges).
>
>> See CSIDL_INTERNET_CACHE in MSDN.
>
>I know how to test for *specific* temporary directories, but I want to
>know whether the file is in *any* temporary location. Basically I
>want to know if the file might 'disappear' *without* the user
>explicitly deleting it.
>
>Richard.
>http://www.rtrussell.co.uk/
From: David Lowndes on
>> Given that your definition of transient is ambiguous, it'll be
>> difficult to come up with a definitive answer. What is it that you're
>> trying to achieve, maybe there's some other solution?
>
>The scenario is an executable which acts as a plug-in for an
>application; when first executed it 'installs' itself in the
>application (basically by recording its location in the registry). If
>the executable is located on a network or removable drive, or in a
>temporary directory, it must first copy itself to a 'safe' place, but
>otherwise it doesn't bother (to avoid making an unnecessary copy,
>which might require admin privileges).
>
>> See CSIDL_INTERNET_CACHE in MSDN.
>
>I know how to test for *specific* temporary directories, but I want to
>know whether the file is in *any* temporary location. Basically I
>want to know if the file might 'disappear' *without* the user
>explicitly deleting it.

AFAIK there is no solution to your problem, other than to empirically
determine all the scenarios that can occur and handle them
specifically.

Dave
From: Tim Roberts on
Hector Santos <sant9442(a)nospam.gmail.com> wrote:
>
>> I want to determine whether a file is 'transient', i.e. in a 'non
>> permanent' location. Specifically I want to know if it is in one of
>> these places:
>>
>> 1. On a network drive/volume.
>> 2. On a removable drive/volume.
>> 3. In a 'temporary' location such as Temporary Internet Files.

How does "Temporary Internet Files" qualify as temporary? Files can be
deleted from ANYWHERE.

I'm also not sure why a network drive qualifies as "temporary".

What's the use case here?
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.