×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    14

    how to delete e32db.Dbms database?

    Hello,

    I used e32db.Dbms to create a database and want to programatically delete the entire database. I didn't see how to do it in the API documentation. Is this possible? Thanks,

    Albert

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    11
    You can use a lot of regular python stuff for dealing with files - it's not documented in the api.

    eg.

    the_file = open(file_name,'w')
    the_file.write(text)
    the_file.close()

    Look at filebrowser.py, you can delete files with it, so it must have code for deleting.

    Let us know what works,

    K
    http://nokiapython.blogspot.com/

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    14
    that's what I originally thought, but when I looked through the file system with the filebrowser, and with fexplorer, the file didn't show up. I also tried blindly deleting it with os.unlink(), but that failed. Are the databases not stored on the filesystem, or am I doing something wrong?

  4. #4
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643
    Originally posted by relbs
    that's what I originally thought, but when I looked through the file system with the filebrowser, and with fexplorer, the file didn't show up. I also tried blindly deleting it with os.unlink(), but that failed. Are the databases not stored on the filesystem, or am I doing something wrong?
    Yes, they are stored in the filesystem. You must have used the wrong name for it. Note that if you give a normal string to the e32db.open function the call will succeed, but the file that is created has a name that consists of whatever garbage the interpretation of the bytes in the string as Unicode data will produce.

    Try creating the DB using an absolute Unicode pathname, for example u"c:\\foo.db".

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    14
    this was the problem (normal string pathname instead of unicode), thanks!

Posting Permissions

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