| Reply | « Previous Thread | Next Thread » |
|
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. |
|
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.
|
| eriksmartt |
| View Public Profile |
| Find all posts by eriksmartt |
|
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. |
|
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! |
| eriksmartt |
| View Public Profile |
| Find all posts by eriksmartt |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |