blob: 9a3ecd71f19dbf48d130a12af1c9f6f3b83e0512 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import os
szBaseDir = os.getcwd()
# changes to a new directory, independent of where we are on the drive
def ChangeDir(szDest):
os.chdir(szBaseDir + szDest)
# deletes a file of disk, ignoring any assert if the file doesn't exist
def DeleteFile(szFile):
try:
os.unlink(szFile)
except OSError, e:
pass
# returns true if a file exists on disk
def FileExists(szFile):
try:
os.stat(szFile)
return 1
except OSError, e:
return
def ListFiles(szExtension):
try:
szAllFiles = os.listdir(os.getcwd())
return szAllFiles
except OSError, e:
return
|