You Are Here:

Community: Developer Discussion Boards

#1 Old USB and drive letters - 2009-03-10, 14:24

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
I have an app that saves data files to the mass storage so the user can transfer them to a computer via USB.

So far I have assumed that using USB you can only access the mass storage drive and not the phone memory. Is this true?

Also, I’ve assumed the mass storage drive is always E: and phone memory is always C: (at least for 3rdEd phones). But this article suggests that these may not be good assumptions.

So how, in PyS60, do I programmatically find out which drive to use such that the files can be seen via USB?

Thanks
Reply With Quote

#2 Old Re: USB and drive letters - 2009-03-11, 21:15

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
No suggestions on how to find out which drive is the mass memory?

Is it safe to assume its E: ?
Reply With Quote

#3 Old Re: USB and drive letters - 2009-03-12, 17:45

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by kabinda View Post
No suggestions on how to find out which drive is the mass memory?
Is it safe to assume its E: ?
No, it's not safe. Somewhere there was generic code to detect the drive type, but right now I'm busy coding. Please try searching DiBo.

Sorry,

--jouni
Reply With Quote

#4 Old Re: USB and drive letters - 2009-03-13, 14:36

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
I’ve searched this forum and the available PyS60 Docs and I can’t find anything that returns the type of available drives.

Code:
drive_list()
...returns a list of currently visible drives as a list of Unicode strings '<driveletter>:' - But not their type.

So how do I find out which drive letter is the mass memory?
Reply With Quote

#5 Old Re: USB and drive letters - 2009-03-14, 19:22

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by kabinda View Post
I’ve searched this forum and the available PyS60 Docs and I can’t find anything that returns the type of available drives.

Code:
drive_list()
...returns a list of currently visible drives as a list of Unicode strings '<driveletter>:' - But not their type.

So how do I find out which drive letter is the mass memory?
Good reply! Therefore I used 15 mins to search and also could not find anything, sorry. Just this piece of code, which you already seem to have seen:

Code:
import e32
print e32.drive_list()
[u’C:’ ,u’D:’ ,u’E:’ ,u’Z:’]
I would say that you can rely on C and Z to remain same in all devices, most likely also D. Anything else is open game, could be anything. Also do not rely on alphabetical order, some letters can be missing in between. As Lucian wrote:

Quote:
# Z: the ROM drive where the firmware resides
# C: the internal flash memory drive (aka. phone memory)
# D: the RAM mapped drive used as a temporary fast access file cache
My suggestion: everything else could be mass storage. Btw have you actually tested this? Do you really need "mass storage" for USB? I recall that when I tried to connect via USB cable in non-pc suite mode, I lost access to memory card. Since I especially needed access to memory card, in order to transfer python files over there, I very quickly stopped doing that

So, instead of finding out disk types, maybe you should find out which drives you can access in which data transfer mode? Just wondering, if you're still focused in right question, sorry! Why would you care whether disk is memory card, mass storage or flash?

Cheers,

--jouni got run again...
Reply With Quote

#6 Old Re: USB and drive letters - 2009-03-16, 21:18

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
Quote:
Originally Posted by JOM View Post
So, instead of finding out disk types, maybe you should find out which drives you can access in which data transfer mode? Just wondering, if you're still focused in right question, sorry! Why would you care whether disk is memory card, mass storage or flash?

Cheers,

--jouni got run again...
Thanks for the repy

Well, my app saves out data files and I want it to be as simple as possible for the user to copy these to their computer. Users may not have bluetooth on their computer so I thought via the USB cable would be simplist.

So I don't care whether the drive is memory card, mass storage or flash but I do want to save data to a drive that is accessable via USB. So how do I find that out without assuming its the E: drive?

Thanks for your help
Reply With Quote

#7 Old Re: USB and drive letters - 2009-03-17, 07:28

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by kabinda View Post
Well, my app saves out data files and I want it to be as simple as possible for the user to copy these to their computer. Users may not have bluetooth on their computer so I thought via the USB cable would be simplist.

So I don't care whether the drive is memory card, mass storage or flash but I do want to save data to a drive that is accessable via USB. So how do I find that out without assuming its the E: drive?
Just tried to connect N82 as USB Data Transfer. As I recalled, there was first warning that memory card access is disabled. That should rule E-disk out right away. After that I got connection error

I would try c:\data\my_own_subdir

Cheers,

--jouni
Reply With Quote

#8 Old Re: USB and drive letters - 2009-03-17, 10:40

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
Quote:
Originally Posted by JOM View Post
Just tried to connect N82 as USB Data Transfer. As I recalled, there was first warning that memory card access is disabled. That should rule E-disk out right away. After that I got connection error

I would try c:\data\my_own_subdir

Cheers,

--jouni
Doesn’t the warning message just mean that apps on the phone can’t access the E: while its being accessed externally via USB ? (The user doesn’t need to access the data files while my app is running)

On my N95 and 6220c the only drive I can access via USB cable is the E: drive (mass storage). I can’t see the contents of the C: (phone memory)?
Reply With Quote

#9 Old Re: USB and drive letters - 2009-03-19, 18:06

Join Date: Mar 2003
Posts: 125
Location: UK
aya42
Offline
Regular Contributor
Quote:
Originally Posted by kabinda View Post
So how, in PyS60, do I programmatically find out which drive to use such that the files can be seen via USB?
There might be some way to do this with an extension module, but in pure Python, I doubt there's a way of doing this that would work with not only every phone available, but every phone that will ever be released in the future.

I'd just make it a user-configurable option, which defaults to E:.
Reply With Quote

#10 Old Re: USB and drive letters - 2009-03-20, 10:52

Join Date: Feb 2009
Posts: 17
kabinda
Offline
Registered User
So I can give the user options for which drive letter they want to save to. But I can’t give them options to save to ‘Mass Memory’ or ‘Phone Memory’ as I can’t determine which drive letter these are.

Thanks for the help anyway.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Nokia N-Series Complete Model Line-Up Dopod General Discussion 6 2008-07-22 21:16
Problem MMC+USB Connection Fede81 General Symbian C++ 1 2007-06-14 07:13
DKU-2 to USB rulirahm PC Suite API and PC Connectivity SDK 2 2007-02-04 05:23
Problem MMC+USB Connection Fede81 General Discussion 3 2006-07-19 16:21
Nokia 6680 and USB Pen Drive andredimu General Discussion 1 2005-09-01 14:30

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia