|
| File Operation Functions : | Function Index |
Function
Description:
Use this utility function to
compare content of the two files. This function will compare two files
present in the server system where QEngine runs and if it find both are
similar, it will return 0.
How
to Define:
compareFile("baseFileName","CheckFileName")
The files will be verified for its content, date/time of creation and if all matches then only it will return Success.
Example:
compareFile("C:\test\masterfile.csv","C:\test\checkfile.csv")
Return
Value:
0 for Success
1 for Failure
Function
Description:
Use this utility function to get number
of files / directory identified by a keyword, present under the given
directory in the server system where QEngine runs. This will return the
obtained count.
How
to Define:
getFileCount("Directory_Path","FILE_TYPE")
Directory_Path
= The full path of the directory in
the server system from where file count has to be obtained.
FILE_TYPE
= The file type states which type
of file has to be counted
ONLY_FILES = To get only the number of files present
in given directory
ONLY_DIRECTORY = To get only the number of directories
present in given directory
FILES_AND_DIRECTORY == To get the
file count including both Files and Directories.
Example:
count
= getFileCount("c:\test\mytest\","FILES_AND_DIRECTORY")
In
the above case,
The
number of files matches the files and directory file types will be
counted and the count will be returned and assigned to "count"
variable.
Return Value:
Integer - Count of file matching the "FILE_TYPE" given in the second argument.
Function
Description:
Use this utility function to get
the size of the file present in the server system where QEngine runs in
bytes.
How
to Define:
size
= getFileSize("filename")
In
the above case,
The size of the given file in bytes will be retrieved and stored in the "size" variable.
Example:
size
= getFileSize("C:\test\MyPhoto.gif")
displayMessage(size)
Return
Value:
Integer - size of the file in bytes.
Function
Description:
Use this utility function to get
total number of lines present in the file with given filename in the
server system where QEngine runs.
How
to Define:
linecount
= getLinesInFile("filename")
In
the above case,
The total number of lines present in the file with given file name will be retrieved and will be assigned to linecount to use it in further down the script.
Example:
linecount =
getLinesinFile("C:\test\MyFile.txt")
displayMessage(linecount)
Return Value:
Integer
Function
Description:
Use this utility function to get
the number of occurrences of the specified search string in the file
with the given file name in the server system where QEngine runs.
How
to Define:
getStringCountInFile("fileName","search_string")
Example:
count =
getStringCountInFile("C:\test\MyFile.txt","QEngine")
Return Value:
Integer - Number of occurence of
the given search_string.
Function
Description:
Use this utility function to check
whether the file with the given file name exists in the zip file with
given zip file name.
How
to Define:
isFileInZip("ZipFile","FileName")
Example:
isFileInZip("C:\test\MyZip.zip","MyFile.txt")
Return Value:
0 for Success
1 for Failure
Function
Description:
Use this utility function to check
whether the given search string exists in the file with the given file
name.
How
to Define:
isStringInFile("Search_String","FileName")
Example:
Return Value:
0 for Success
1 for Failure
Function
Description:
Use this utility function to check
whether the given search string exists in the file with the given file
name where the file exists in the given zip file.
How
to Define:
isStringInZip("ZipFile","FileName","Search_String")
Example:
Return
Value:
0 for Success
1 for Failure
|