Hi,

> OSError: [Errno 2] No such file or directory: 'alfresco20140104-0000.sql'

> I get results if I do it without giving the dir location such as

That is because the getctime call will run based in the current working
directory. You can use a construct like:

  max([os.path.join('opt', 'foo', x) for x in os.listdir(os.path.join('opt', 
'foo')], key=os.path.getctime)

That uses a list comprehension to prepend the full path to the results.
You could also chdir() to the location beforehand.

Please always use os.path.join().

-nik

-- 
<Natureshadow> Auf welchem Server liegt das denn jetzt…?
<mirabilos> Wenn es nicht übers Netz kommt bei Hetzner, wenn es nicht
            gelesen wird bei STRATO, wenn es klappt bei manitu.

PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to