×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    13

    Filesizes and checking for space

    Does anyone know if an API exists for working with the filesystem as far as checking for filesizes and how much space is left?

    Thanks.

  2. #2
    Regular Contributor
    Join Date
    Jul 2004
    Posts
    76
    Access to the remaining drive space is listed as a feature request on the main Feature Request thread: http://discussion.forum.nokia.com/fo...threadid=55845, and I haven't heard of a work-around yet.

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    13
    Yeah, I just noticed that too. Thanks.

    What about for the other half of the question - does anyone know if there's a way to check a file's size within the filesystem through Python?

    For example, I'm thinking about serializing an object and then sending it over to another phone (currently, the plan is using the pickle module). But in order to be able to send it, the comm unit needs to know the size of the serialized object. Currently I don't see anything in the pickle module about this, nor can I find any other API to doing it.

  4. #4
    Regular Contributor
    Join Date
    Jul 2004
    Posts
    76
    how about just using os.stat(filepath) ? It works for me. For more on using stat, try: http://www.python.org/doc/current/lib/module-stat.html

    Cheers!

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    10

    checking free disk space

    There is a function for checking the free disk space buried in the PDIS code. Here's how to use it. -Ken Rimey

    # The following requires aosocket-series60_v20.sis from the PDIS
    # distribution. Fetch the compressed tar of pdis-0.7.x from
    # http://pdis.hiit.fi/pdis/download/pdis/ and look in the
    # pdis/symbian/binaries directory for the aosocket sis archive. We
    # can't promise that this API will continue to exist in future
    # releases; it doesn't have anything to do with sockets and should
    # probably be pulled out with other such stuff into a separate module
    # someday. -Ken Rimey, 2.2.2005

    from aosocketnativenew import disk_total_avail

    print "Free space:"
    print " C:", disk_total_avail(2)
    print " D:", disk_total_avail(3)
    print " E:", disk_total_avail(4)

Posting Permissions

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