GO2cam Javascript API  6.11
GO2SFileUtil Class Reference

Class of utilitary methods for files. More...

Inherits QObject, and CFileHelper.

Static Public Member Functions

static Boolean Copy (String pathFrom, String pathTo, Boolean bOverrideIfExists=true)
 Copy a file.
 
static Number CopyDirContent (String pathFrom, String pathTo, Boolean bOverrideIfExists=true, int pNbNotCopied=nullptr)
 
static Boolean DeleteDirectory (String dir)
 Delete the directory.
 
static Boolean Exists (String dir, String name)
 Get if the file exists.
 
static Boolean Exists (String path)
 Get if the file exists.
 
static String ExtractDirectory (String path)
 Get directory path from full path.
 
static String ExtractFilename (String path, Boolean withExtension=true)
 Get file name from path with or whitout extension.
 
static String GenerateTmpFile (String dir, String ext="tmp")
 Generate a tmp file.
 
static String GetApplicationDirectory ()
 Get the application directory.
 
static String GetApplicationFullPath ()
 Get the application full path.
 
static Array< int > GetCreationDate (String dir, String name)
 
static Array< int > GetCreationDate (String fname)
 
static String GetCurrentWorkingDirectory ()
 Get the current working directory.
 
static Array< String > GetFileList (String path, String extension="")
 Get the file list of a directory with a specific extension.
 
static Array< String > GetFileListName (String path, String fileName)
 Get the file name list of a directory with a specific extension.
 
static size_t GetFileSize (String dir, String name)
 Get the size of a file.
 
static size_t GetFileSize (String fname)
 Get the size of a file.
 
static Array< int > GetModificationDate (String dir, String name)
 
static Array< int > GetModificationDate (String fname)
 
static Array< String > GetPrefixFileListName (String path, String prefix)
 Get the file name list of a directory with a prefix.
 
static String GetSystemTempPath ()
 Get the system temp path.
 
static Boolean HasFileList (String path, String extension)
 Get if they are files with a specific extension.
 
static Boolean IsAbsolute (String path)
 
static Boolean IsBinary (String dir, String name)
 Get if the file is a binary file.
 
static Boolean IsDirectory (String dir)
 Get if is a directory.
 
static Boolean IsReadable (String dir, String name)
 Get if the file is readable.
 
static Boolean IsReadable (String path)
 Get if the file is readable.
 
static Boolean IsWritable (String dir, String name)
 Get if the file is writable.
 
static Boolean IsWritable (String path)
 Get if the file is writable.
 
static String MakeAbsolute (String path)
 Transform a relative path into an absolute path.
 
static Boolean MakeAllSubDirectories (String dir, String path)
 Make all subdirectories contained in path in dir folder.
 
static Boolean MakeDirectories (String dir)
 Create a directory and his parents if they are not created yet.
 
static Boolean MakeDirectory (String dir)
 
static String MakePath (String path, String fileName)
 Make full path.
 
static String MakeRelative (String path, String dir)
 Transform a absolute path into a relative path.
 
static Boolean Remove (String dir, String name)
 Remove a file or a directory.
 
static Boolean Remove (String path)
 Remove a file or a directory.
 
static Boolean RemoveFilesByWildCards (String dir, String WildCardName)
 Remove a file by wild card.
 
static void RemoveReadOnly (String path, Boolean bRecursive=false)
 Remove the read only status of a file.
 
static Boolean Rename (String oldName, String newName)
 Rename a file or a directory.
 
static Boolean SetCurrentWorkingDirectory (String dir)
 Set the current working directory.
 

Detailed Description

Class of utilitary methods for files.

Member Function Documentation

◆ CopyDirContent()

static Number GO2SFileUtil::CopyDirContent ( String pathFrom,
String pathTo,
Boolean bOverrideIfExists = true,
int pNbNotCopied = nullptr )
inlinestatic

Copy the content of a directory

Returns
number of failed copy

◆ GetCreationDate() [1/2]

static Array< int > GO2SFileUtil::GetCreationDate ( String dir,
String name )
static

Get the creation date of a file

Returns
will be [year,month,day,hour,minute]

◆ GetCreationDate() [2/2]

static Array< int > GO2SFileUtil::GetCreationDate ( String fname)
static

Get the creation date of a file

Returns
will be [year,month,day,hour,minute]

◆ GetModificationDate() [1/2]

static Array< int > GO2SFileUtil::GetModificationDate ( String dir,
String name )
static

Get the modification date of a file

Returns
will be [year,month,day,hour,minute]

◆ GetModificationDate() [2/2]

static Array< int > GO2SFileUtil::GetModificationDate ( String fname)
static

Get the modification date of a file

Returns
will be [year,month,day,hour,minute]

◆ IsAbsolute()

static Boolean GO2SFileUtil::IsAbsolute ( String path)
inlinestatic

Get if the path is an absolute path

Returns
true if absolute, false if relative

◆ MakeDirectory()

static Boolean GO2SFileUtil::MakeDirectory ( String dir)
inlinestatic

Create a directory

Warning
will only create a directory if a parent exists