Path: news.mathworks.com!not-for-mail
From: "Mamata Kukreja" <mamata_kukreja@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Detecting System Drive ( urgent help )
Date: Mon, 5 May 2008 06:45:05 +0000 (UTC)
Organization: SIES
Lines: 94
Message-ID: <fvmadh$163$1@fred.mathworks.com>
References: <fp2sop$hsl$1@fred.mathworks.com> <fp30am$ljd$1@canopus.cc.umanitoba.ca> <fp31o5$jq0$1@fred.mathworks.com> <fp4b3e$csc$1@canopus.cc.umanitoba.ca>
Reply-To: "Mamata Kukreja" <mamata_kukreja@yahoo.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209969905 1219 172.30.248.35 (5 May 2008 06:45:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 May 2008 06:45:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1253471
Xref: news.mathworks.com comp.soft-sys.matlab:466608


roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fp4b3e$csc$1@canopus.cc.umanitoba.ca>...
> 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


-----------------------------------------------------------

% get the list of current drives
     import java.io.*;
     f=File('');
     r=f.listRoots;
for i=1:numel(r)
     disp(sprintf('%s',char(r(i))));
end
% now you'd have to check each one for the
% contents you're looking for, eg,
     dir(char(r(1)));


ERROR::
??? Undefined command/function 'toChar'.

Error in ==> opaque.char at 94
    chr = toChar(opaque_array(1));

Error in ==> untitled at 6
     disp(sprintf('%s',char(r(i))));