From 3db682fdea68e05a29e15b66a959f00b399b1159 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Fri, 19 Aug 2005 14:25:42 +0000 Subject: [PATCH] =?UTF-8?q?=20touch=20e=C4=9Fer=20dosya=20varsa=20eri?= =?UTF-8?q?=C5=9Fim=20tarihini=20g=C3=BCncellesin,=20yoksa=20yarats=C4=B1n?= =?UTF-8?q?..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/shelltools.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index e5b76e21..ecf60af8 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -66,8 +66,13 @@ def copytree(source, destination, sym=False): shutil.copytree(source, destination, sym) def touch(sourceFile): - for file in glob.glob(sourceFile): - os.utime(file, None) + '''changes the access time of the 'sourceFile', or creates it if it is not exist''' + if glob.glob(sourceFile): + for file in glob.glob(sourceFile): + os.utime(file, None) + else: + f = open(sourceFile, 'w') + f.close() def cd(directoryName = ''): '''change directory'''