1 # -*- coding: utf-8 -*-
6 IronPython support library. This library exports functionality from
7 the CLR to Python that is normally available in the standard library.
9 :copyright: Copyright 2008 by Armin Ronacher.
12 from System import DateTime
13 from System.IO import Path, File, FileInfo
16 epoch = DateTime(1970, 1, 1)
19 class _PathModule(object):
20 """A minimal path module."""
22 sep = str(Path.DirectorySeparatorChar)
23 altsep = str(Path.AltDirectorySeparatorChar)
26 def join(self, path, *args):
27 args = list(args[::-1])
29 path = Path.Combine(path, args.pop())
32 def isfile(self, filename):
33 return File.Exists(filename)
35 def getmtime(self, filename):
36 info = FileInfo(filename)
37 return int((info.LastAccessTimeUtc - epoch).TotalSeconds)