Hi, I am from the PyS60 (Python port on S60 platform) team. We have ported the Python 2.5.4 core in the latest 1.9.x series of PyS60. http://wiki.opensource.nokia.com/projects/PyS60 Currently we have a problem with the mailbox module. Check the code snippet below, from the mailbox module. *def clean(self): """Delete old files in "tmp".""" now = time.time() for entry in os.listdir(os.path.join(self._**path, 'tmp')): path = os.path.join(self._path, 'tmp', entry) if now - os.path.getatime(path) > 129600: # 60 * 60 * 36 os.remove(path)* The code in red, tries to delete the files that are not accessed in the last 36 hours. Any idea as to how this is supposed to work on platforms that do not support access time, for example Symbian/S60 ? Any work around ? - Mahesh
Great news on the port! On your issue: Is this module relevant for the platform? Do you know of any existing app that uses the qmail mailbox format? As a work-around, I can think of several values to substitute for atime: the current time, or the mtime, or perhaps even the max of mtime and ctime. --Guido On Tue, Mar 10, 2009 at 10:11 AM, Mahesh S <mahesh.sayibabu@gmail.com> wrote:
Hi,
I am from the PyS60 (Python port on S60 platform) team. We have ported the Python 2.5.4 core in the latest 1.9.x series of PyS60. http://wiki.opensource.nokia.com/projects/PyS60
Currently we have a problem with the mailbox module. Check the code snippet below, from the mailbox module.
def clean(self): """Delete old files in "tmp".""" now = time.time() for entry in os.listdir(os.path.join(self._path, 'tmp')): path = os.path.join(self._path, 'tmp', entry) if now - os.path.getatime(path) > 129600: # 60 * 60 * 36 os.remove(path)
The code in red, tries to delete the files that are not accessed in the last 36 hours. Any idea as to how this is supposed to work on platforms that do not support access time, for example Symbian/S60 ? Any work around ?
- Mahesh
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
On Tue, 10 Mar 2009 at 22:41, Mahesh S wrote:
I am from the PyS60 (Python port on S60 platform) team. We have ported the Python 2.5.4 core in the latest 1.9.x series of PyS60. http://wiki.opensource.nokia.com/projects/PyS60
Currently we have a problem with the mailbox module. Check the code snippet below, from the mailbox module.
*def clean(self): """Delete old files in "tmp".""" now = time.time() for entry in os.listdir(os.path.join(self._**path, 'tmp')): path = os.path.join(self._path, 'tmp', entry) if now - os.path.getatime(path) > 129600: # 60 * 60 * 36 os.remove(path)*
The code in red, tries to delete the files that are not accessed in the last 36 hours. Any idea as to how this is supposed to work on platforms that do not support access time, for example Symbian/S60 ? Any work around ?
Many unix systems (especially laptops) now run with the 'noatime' option set on their file systems. On my system with noatime set, atime appears to be equal to mtime, so assuming you have mtime, returning that for atime would appear to be de facto standards compliant. -- R. David Murray http://www.bitdance.com
participants (3)
-
Guido van Rossum -
Mahesh S -
R. David Murray