×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    77

    How to check if memory card is installed?

    I try to check if the memory card is installed in my 6120c running PyS60 1.4.2 using e32.drive_list(). Although the memory card is removed from the phone, e32.drive_list() returns [u'C:',u'D:',u'E:',u'Z:']. The S60 file manager says: 'no memory card inserted'.
    os.path.exists(u"E:\\") also returns True, although the memory card isn't inserted.

    Can anyone confirm this and/or offer a workaround?

    TIA Martin

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to check if memory card is installed?

    Quote Originally Posted by dehlerm View Post
    I try to check if the memory card is installed in my 6120c running PyS60 1.4.2 using e32.drive_list(). Although the memory card is removed from the phone, e32.drive_list() returns [u'C:',u'D:',u'E:',u'Z:']. The S60 file manager says: 'no memory card inserted'.
    os.path.exists(u"E:\\") also returns True, although the memory card isn't inserted.

    Can anyone confirm this and/or offer a workaround?

    TIA Martin
    hi martin
    i have tried the same thing once earlier and it didnt showed my external memory drive as it was not available.
    have a feedback.

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: How to check if memory card is installed?

    Quote Originally Posted by dehlerm View Post
    I try to check if the memory card is installed in my 6120c running PyS60 1.4.2 using e32.drive_list(). Although the memory card is removed from the phone, e32.drive_list() returns [u'C:',u'D:',u'E:',u'Z:']. The S60 file manager says: 'no memory card inserted'.
    os.path.exists(u"E:\\") also returns True, although the memory card isn't inserted.

    Can anyone confirm this and/or offer a workaround?

    TIA Martin
    You can use Try and Except algorithm,
    It always works for me

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    77

    Re: How to check if memory card is installed?

    Thanks for your replies!

    @gaba88
    e32.drive_list(): did work on your device and returned [u'C:',u'D:'u'Z:'] when no memory card was installed?

    @croozeus
    try: and except: is indeed the way I used now. Does your usage of try/except mean, that e32.drive_list(): doesn't work for you too?
    Interestingly os.path.exists(u"E:\\") did not raise an error when no memory card was present, but os.path.exists(u"E:\\path").
    A 'if u"E:" in e32.drive_list():' would be a little bit nicer code, from my point of view ;-)

    Thanks
    Martin

  5. #5
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How to check if memory card is installed?

    Not sure if this works mate but try it :-

    Code:
    import misty
    
    print misty.memcard_inserted
    Give it a go but it's in misty v1.92
    Last edited by Dansco; 2008-05-05 at 22:36.

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to check if memory card is installed?

    Quote Originally Posted by dehlerm View Post
    Thanks for your replies!

    @gaba88
    e32.drive_list(): did work on your device and returned [u'C:',u'D:'u'Z:'] when no memory card was installed?

    @croozeus
    try: and except: is indeed the way I used now. Does your usage of try/except mean, that e32.drive_list(): doesn't work for you too?
    Interestingly os.path.exists(u"E:\\") did not raise an error when no memory card was present, but os.path.exists(u"E:\\path").
    A 'if u"E:" in e32.drive_list():' would be a little bit nicer code, from my point of view ;-)

    Thanks
    Martin
    hi martin
    sorry it worked that time but now its not working in my new device i dont know why.
    and in emulator where no memory card is there it shows the drive.

  7. #7
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: How to check if memory card is installed?

    Hello everybody ,

    @Dansco : You have been faster than me

    Try this
    Code:
    print misty.card_inserted() 
    # 1 if exist 0 else
    Try this
    Code:
    print pathinfo.memorycard_path() 
    # returns u'e:\\' if exist on 3rd
    links : pathinfo

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  8. #8
    Registered User
    Join Date
    Sep 2003
    Posts
    77

    Re: How to check if memory card is installed?

    Dear all!

    Thanks for your replies and the several workarounds mentioned!
    Seems that e32.drive_list(): is not working very reliable :-(
    I decided to stay with the os.path.exists(u"E:\\path") try/except solution.
    Not because I don't like the recommended modules, but because I try to avoid usage of modules as often as possible. (From my (non professional) point of view modules currently complicate the SIS creation too much and might cause version conflicts when different applications install different modul versions to different locations...)

    Thanks Martin

  9. #9
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Smile Re: How to check if memory card is installed?

    Quote Originally Posted by dehlerm View Post
    @croozeus
    try: and except: is indeed the way I used now. Does your usage of try/except mean, that e32.drive_list(): doesn't work for you too?
    Interestingly os.path.exists(u"E:\\") did not raise an error when no memory card was present, but os.path.exists(u"E:\\path").
    A 'if u"E:" in e32.drive_list():' would be a little bit nicer code, from my point of view ;-)
    Sorry for replying late. I have never used the e32.drive_list(): as I prefer the try/except method.

    But now you already have a very good solution with Misty

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  10. #10
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How to check if memory card is installed?

    Quote Originally Posted by cyke64 View Post
    Hello everybody ,

    @Dansco : You have been faster than me

    Try this
    Code:
    print misty.card_inserted() 
    # 1 if exist 0 else
    Try this
    Code:
    print pathinfo.memorycard_path() 
    # returns u'e:\\' if exist on 3rd
    links : pathinfo

    BR
    Cyke64
    I only know that coz I was looking in the Misty files for keylock

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to check if memory card is installed?

    hi all
    is it a bug or what is the problem with e32.drive_list().
    why its not working.
    waiting for reply

  12. #12
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: How to check if memory card is installed?

    Quote Originally Posted by Dansco View Post
    I only know that coz I was looking in the Misty files for keylock
    Yeah
    keylock is locked in another version not released
    Sorry , I'm working on it because it works perfectly on my N95 !
    Surely a keylock module for 3rd

    Very soon ...

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  13. #13
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to check if memory card is installed?

    hi cyke64
    its a great news that a keylock module soon.

  14. #14
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How to check if memory card is installed?

    Quote Originally Posted by cyke64 View Post
    Yeah
    keylock is locked in another version not released
    Sorry , I'm working on it because it works perfectly on my N95 !
    Surely a keylock module for 3rd

    Very soon ...

    BR
    Cyke64
    Have got the keylock sorted now mate, check out my thread

Similar Threads

  1. N95 : Installation error on inserting the memory card after resetting the phone
    By Amolmaheshwari in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 3
    Last Post: 2008-11-02, 11:30
  2. does the E70 render the memory card read-only?
    By darkeye in forum General Development Questions
    Replies: 2
    Last Post: 2006-12-17, 14:09
  3. N80 memory card problem after update
    By fjorge_ht in forum General Development Questions
    Replies: 6
    Last Post: 2006-11-04, 16:59
  4. Storing my data on memory card on Series 40 phones
    By Sammybar in forum Mobile Java General
    Replies: 1
    Last Post: 2005-12-28, 17:40
  5. memory card
    By mary_adi in forum General Development Questions
    Replies: 0
    Last Post: 2004-09-01, 08:15

Posting Permissions

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