- Timestamp:
- 23/04/08 17:24:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/FileUtilities.py
r3815 r3821 1 1 import os, sys, logging 2 from os import makedirs 3 from os.path import normpath,dirname,exists,abspath 2 4 3 5 class FileUtilities: … … 10 12 Constructor 11 13 ''' 14 15 def createFile(self, fileName, content): 16 ''' 17 Create a file with the specified name and content 18 @param fileName: name of file to create 19 @param content: content of file to create 20 ''' 21 try: 22 f = open(fileName,'w') 23 f.write(content) 24 f.close() 25 except: 26 sys.exit("ERROR: Problem encountered when creating file, %s" %fileName) 12 27 13 28 … … 25 40 from holger@trillke.net 2002/03/18 26 41 ''' 27 from os import makedirs28 from os.path import normpath,dirname,exists,abspath29 30 42 logging.info("Creating dir: " + path) 31 43 dpath = normpath(dirname(path)) … … 45 57 else: 46 58 try: 47 makepath(dir)59 self.makepath(dir) 48 60 except: 49 61 sys.exit("Failed at setting up directory, %s" %dir)
Note: See TracChangeset
for help on using the changeset viewer.