I need to write a Windows service that will automatically move files from an incoming directory to a time-based directory structure. It will need to make new directories as needed.
One possibility is:
Is this way adequate, or is there a better way?
One possibility is:
Code:
ON ERROR RESUME NEXT 'don't fail if any dir exists 'unconditionally attempt to create each directory MKDIR TRIM$(STR$(year)) MKDIR TRIM$(STR$(month)) MKDIR TRIM$(STR$(day)) MKDIR TRIM$(STR$(hour)) ... NAME IncomingFile AS RootDir+"\"+TRIM$(STR$(year))+"\"+TRIM$(STR$(month))+"\"+TRIM$(STR$(day))+"\"+TRIM$(STR$(hour))+"\"+IncomingFile
Comment