×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    26

    os.remove problems

    Hi Guys,

    i have two user profiles in my app, both which have a separate database associated with each profile. The user can add profiles no problem, for this i use execfile.

    But when i try to delete a file from my application it wont delete it. Iget errno 13 which i presume is that the file is in use. how can i know for sure whether its in use? i need these files deleted from within the app... but yet they wont go.

    if i run them from outide the application.. like if i just run deleteDB.py file from the menu the db goes but i need to do it from within an application

    i use the code..

    Code:
          receive_path = "e:\\Python\\User1.db"
    
          if(os.path.exists(receive_path)):
             os.remove(receive_path)
    Any ideas?
    Thanks

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

    Re: os.remove problems

    hi neil
    i think probably ur logic is bit incorrect.in the if statement of ur code you are checking that ur file exists or not i.e. ur file is in use so how one can delete it.
    have a feedback.

  3. #3
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: os.remove problems

    Hi,

    This is because if you open a file for performing any operations, like read or write, you should always close it with a f.close() function. May be thats the problem in your case. And so it give the error.
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

Similar Threads

  1. CTelephony Problems in N73
    By saji_iq in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-02-07, 07:57
  2. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2006-03-20, 13:00
  3. Several problems with NMIT 4.1 MMS
    By jtalviva in forum General Messaging
    Replies: 0
    Last Post: 2006-03-10, 11:03
  4. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  5. general problems in 3410
    By fredgauchet in forum Mobile Java General
    Replies: 1
    Last Post: 2002-08-26, 14:38

Posting Permissions

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