2.1.10 File Management

Functions

Name Brief Example
_chdir change the current working directory to the specified path Examples
_chdrive change the current working drive Examples
_getcwd get the current working path Examples
_getdrive get the current working drive Examples
add_file_extension Add file extension to given string Examples
check_add_file_ext Add or replace extension name of a file. Examples
CheckMakePath Check the given path to see if is existed, if not, then create all the needed folders Examples
CloseHandle This function closes an open object handle. Examples
CopyFile This function copies an existing file to a new file Examples
CreateDirectory The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory Examples
CreateFile This function creates or opens an object and returns a handle that can be used to access the object. Examples
DefaultTemplate Origin's default template access Examples
DeleteFile Delete an existing file. Examples
file_compare Comare the contents of two files. This function does a byte by byte binary compare Examples
FileCopy Copy file and also set destination file's attribute Examples
FindClose The FindClose function closes the specified search handle. The FindFirstFile and FindNextFile functions use the search handle to locate files with names that match a given name. Examples
FindFile Find a file in a given path. If lpSubFolder1st is given (not NULL), then A. if bExcluded = FALSE, then find this subfolder first, B. if bExcluded = TRUE, skip this subfolder Examples
FindFiles List all files in specified folder with specified file extension, or with file name with wild characters. Examples
FindFirstFile Searches a directory for a file whose name matches the specified file name (wildcards are allowed). One can use this function in combination with FindNextFile and FindClose to find all the files in the specified directory. Examples
FindNextFile The FindNextFile function continues a file search from a previous call to the FindFirstFile function. Examples
get_file_group_default_path Options|File Locations Group Column. Examples
get_next_file_name Check to find the filename that does not already exist Examples
get_temp_path Get the temporary path as a string. Examples
GetAppPath Get Origin program path or the user file folder path. Examples
GetFileAttributes Retrieves given file attributes. Examples
GetFileAttributesEx Retrieves attributes for a specified file or directory. It is similar to GetFileAttributes, but it returns more information - in addition to attributes, it also returns various file times and file size. Examples
GetFileModificationDate Get the file modification date of a file from an input string containing a path and filename. Examples
GetFileName Extracts the file name part without the path from a string of full path file name. Examples
GetFileNames Get all the file names in a specified folder that match a specified file specification. Examples
GetFilenamesInFolder Search a windows folder adding any filenames that match a specified file filter to an output string. Options specify whether or not subfolders are to be recursively searched and whether or not path and file extension are to be included with file name. Examples
GetFilenameWithoutExt Get the path and/or just filename without extension from a string containing a path and/or just filename. Examples
GetFilePath Extracts the path from a full path file name string. Examples
GetFileSize Get the file size of a file from an input string containing a path and filename. Examples
GetFullPath Get full path of a file. Examples
GetOriginPath Get Origin program path or user file path or group path. Examples
GetSystemFiles List all files of a specified file type found in the Origin App Data folder and/or in the Origin software folder. Examples
GetTempFileName This function creates a name for a temporary file. Examples
GetTempPath The GetTempPath function retrieves the path of the directory designated for temporary files. Examples
is_str_valid_for_filename Check to see if specified string is a valid file name, no path is allowed Examples
LoadTextFile Get the contents of a text file. Examples
log_file We will always open and write(append) log files and then close so that it is crash proof debug log file store at your Origin home directory Examples
MoveFile Move a file to a new location. Examples
nlsf_install_fdf Add function definition file (FDF) to Origin. Examples
nlsf_uninstall_fdf Remove function definition file (FDF) from Origin. Examples
ocu_delete_files Delete multiple files in the specified path. Examples
ocu_read_text_file Read text file to a string. This function will first detect encoding and can handle unicode text Examples
okoc_folder_browser Open dialog to select multiple folders and return their paths Examples
okutil_composite_name_from_file_path construct composite name from full filepath Examples
okutil_get_custom_path This function is to get current working directory. Examples
okutil_get_file_sections Get all sections name of the file Examples
okutil_get_origin_path Returns the full path to System, Group or User folder, plus a subfolder if desired. Examples
okutil_get_origin_path_type Returns path type from the enum ORIGIN_PATH_TYPE, given a full path Examples
okutil_make_file_path make filepath from path, name, etc Examples
okutil_read_file_section Read an ASCII text file that are like LabTalk OGS files with sections Examples
okutil_read_file_section_keys Get all the key names in a section into a string array from a file. Examples
okutil_read_text_file_lines Read file content into string array. Examples
okutil_set_custom_path This function is to set current working directory. Examples
okutil_write_file_section Works like WritePrivateProfileString, also support comments for section and section without key entry Examples
okutil_write_file_section_keys Write key value of a section into a file. Examples
ReadFileLines Read specified lines from a text file into an array of strings. Examples
RemoveDirectory This function deletes an existing empty directory. Examples
RenameFile Rename a file with full path specified for both old and new file names. The old file name must point to a valid file that can be renamed and the new file name specified must be a full path in the same folder as the original. Examples
SetFileAttributes set a file's attributes Examples
WriteFile This function writes data to a file. WriteFile starts writing data to the file at the position indicated by the file pointer. After the write operation has been completed, the file pointer is adjusted by the number of bytes actually written. Examples
xf_find_file Find XF file for given category Examples