Intruduction
If you are an operation and maintainence engineer, you should have mountains of of work to manage windows files including backup ,migration , statstics etc. This article are trying to explain most common interfaces to interact with windows file system.
'Description:
' Function to create file with specific file name
'Input:
' fullPathStr: the absolute path of the file
' fullFileNameStr: the full name of the file including the file extension
'Output:
' none
'Throw Exception When:
' none
public function create_Log_File(fullPathStr, fullFileNameStr)
on error resume next
if right(fullPathStr) <> "\" and right(fullPathStr) <> "/" then
fullPath = fullPathStr & "\" & fullFileNameStr
else
fullPath = fullPathStr & fullFileNameStr
end if
set fsObj = CreateObject("Scripting.FileSystemObject")
if fsObj.FolderExist(fullPathStr) then
if fsObj.FileExist(fullFileNameStr) then
fsObj.DeleteFile(fullPath)
else
fsObj.OpenTextFile(fullPath, 2, true)
end if
else
Err.Raise 10000, "create_Log_File" , "Folder not exist"
end if
on error goto 0
end function