Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!news.aset.psu.edu!news.cse.psu.edu!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Detecting System Drive ( urgent help )
Date: Fri, 15 Feb 2008 15:28:46 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 49
Message-ID: <fp4b3e$csc$1@canopus.cc.umanitoba.ca>
References: <fp2sop$hsl$1@fred.mathworks.com> <fp30am$ljd$1@canopus.cc.umanitoba.ca> <fp31o5$jq0$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1203089326 13196 192.70.172.160 (15 Feb 2008 15:28:46 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 15 Feb 2008 15:28:46 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:451662


In article <fp31o5$jq0$1@fred.mathworks.com>,
Mamata Kukreja <mamata_kukreja@yahoo.com> wrote:
>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>message <fp30am$ljd$1@canopus.cc.umanitoba.ca>...
>> In article <fp2sop$hsl$1@fred.mathworks.com>,
>> Mamata Kukreja <mamata_kukreja@yahoo.com> wrote:

>> >I want to read images from an external source eg mobile .. 
>> >how to read is clear but how do we detect the system drive
>> >.. ie wen i connect the data cable .. how to detect whether
>> >its  E: or F: or watever differing from system to system.

>> Your question is outside of the reach of Matlab.

>But there should be some solution to reading images from an
>external device .. some command or function .. if i had a
>digital photo keychain .. and want to insert images in it or
>read fromn the SD card .. ?? 

Matlab is not a systems programming language. There doesn't have to
be a solution to any hardware problem within Matlab itself.

Thought experiment: if you were to take the keychain and copy
its contents to another keychain, and then were to put both on the
same system, then how are you going to identify which is the "right"
device? Not by the contents. Therefore you are going to have to
examine the system information tables or make system calls in order
to find out the device serial numbers and compare them to the one
you know to be the right one. This duplication of a device might
sound unlikely, but consider this: on my PC, I can put a camera memory
stick into my printer and have it mounted as a USB drive, and I
can also connect up my camera to the PC and have that mounted as
a USB drive. Which is the right drive? As long as you are trying
to detect the drive automatically instead of asking the user,
you need to track device serial numbers. If you don't know
the device serial numbers ahead of time, it is logicaly impossible
to figure out which of several substantially similar drives is
the right one. Unless, that is, that the key to this is that it
must be the one that was most recently inserted or which must be
inserted while the program is already running.

Poking on my PC a bit, I see that possibly looking in the
registry at HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices
might help to find out which drives are there. There is an entry
for each drive letter.
-- 
  "Man's life is but a jest,
   A dream, a shadow, bubble, air, a vapor at the best."
                                         -- George Walter Thornbury