For Programmers: Free Programming Magazines  


Home > Archive > Matlab > March 2007 > Reading Drive Name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Reading Drive Name
David Borger

2007-03-30, 7:11 pm

In windows explorer my external hard drive shows up as
'SEA_DISK(G:).' Is there a Matlab callable function to which I could
pass 'G:' as a parameter and have it return 'SEA_DISK?'

My problem is that I have two external hard drives, one at work and
one at home, both of which I attach to as G. I would like certain
programs to be able to determine which physical device was attached
at the time.

Dave
Scott Seidman

2007-03-30, 7:11 pm

"David Borger" <borger@ix.netcom.com> wrote in news:ef52db1.-1
@webcrossing.raydaftYaTP:

> In windows explorer my external hard drive shows up as
> 'SEA_DISK(G:).' Is there a Matlab callable function to which I could
> pass 'G:' as a parameter and have it return 'SEA_DISK?'
>
> My problem is that I have two external hard drives, one at work and
> one at home, both of which I attach to as G. I would like certain
> programs to be able to determine which physical device was attached
> at the time.
>
> Dave



Maybe "dos('dir')" will return what you need, maybe not.

Why don't you put a read-only file with a unique name on the root directory
of each drive? That way you can check to see which file exists with a
simple "dir", or even "exist".

Alternatively, you can create diskname.m on each drive, containing a string
with the drive name.


--
Scott
Reverse name to reply
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com