You Are Here:

Community: Developer Discussion Boards

#1 Old Filesizes and checking for space - 2005-01-31, 23:47

Join Date: May 2004
Posts: 13
uh...ok
Offline
Registered User
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.
Reply With Quote

#2 Old 2005-02-01, 22:28

Join Date: Jul 2004
Posts: 76
eriksmartt
Offline
Regular Contributor
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.
Reply With Quote

#3 Old 2005-02-01, 22:57

Join Date: May 2004
Posts: 13
uh...ok
Offline
Registered User
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.
Reply With Quote

#4 Old 2005-02-01, 23:57

Join Date: Jul 2004
Posts: 76
eriksmartt
Offline
Regular Contributor
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!
Reply With Quote

#5 Old checking free disk space - 2005-02-02, 14:30

Join Date: Feb 2005
Posts: 10
yemir
Offline
Registered User
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)
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

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