MatrixBerryCore
Namespaces | Classes | Functions
mxberry::io Namespace Reference

Namespaces

 test
 
 xls
 

Classes

class  PathUtils
 
class  TmpDataManager
 TMPDATAMANAGER implements a basic functionality for managing temporary data folders. More...
 

Functions

function copyfile (in srcName, in dstName)
 COPYFILE is a simplified version of the built-in function that supports long file paths on Windows (>260 symbols). Only copying of a single file to a destination folder/file is supported. More...
 
function isdir (in dirName, in isJavaBased)
 ISDIR returns true if a specified name corresponds to an existing directory. More...
 
function isfile (in fileName, in isJavaBased)
 ISFILE returns true if a specified name corresponds to an existing file. More...
 
function listdirsrecursive (in dirName, in patternStr, in maxDepth)
 LISTDIRSRECURSIVE returns a list of directories with names matching a specified pattern in all the subdirectories of a directory up to the specified depth. More...
 
function listfilesrecursive (in dirName, in patternStr, in maxDepth)
 LISTFILESRECURSIVE returns a list of files with names matching a specified pattern in all the subdirectories of a directory up to the specified depth. More...
 
function mkdir (in dirName)
 MKDIR creates a directory recursively. More...
 
function rmdir (in dirName, in sFlag)
 RMDIR removes a directory (optionally recursively) More...
 

Function Documentation

◆ copyfile()

function mxberry::io::copyfile ( in  srcName,
in  dstName 
)

COPYFILE is a simplified version of the built-in function that supports long file paths on Windows (>260 symbols). Only copying of a single file to a destination folder/file is supported.

*  Input:
*    regular:
*        srcName: char[1,] - source file name
*        dstName: char[1,] - destination file/directory name
* 
*  Output:
*    isSuccess: logical[1,1] - if true, execution was successful
*    msgStr: char[1,] - string containing the warning or error message
*        if operation is unsuccessful, empty otherwise
*    messageId: char[1,] - string containing the warning or error message id
*        if operation is unsuccessful, empty otherwise
* 
*  Note: as opposed to the built-in copyfile function this function doesn't
*    support wildcards and copying multiple files
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ isdir()

function mxberry::io::isdir ( in  dirName,
in  isJavaBased 
)

ISDIR returns true if a specified name corresponds to an existing directory.

*  Input:
*    regular:
*        dirName: char[1,] - directory name to check
* 
*    optional:
*        isJavaBased: logical[1,1] - if true (default), Java-based
*            implementation is used and Matlab implementation - otherwise.
*  Output:
*    isPositive: logical[1,1] - true if the directory exists
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ isfile()

function mxberry::io::isfile ( in  fileName,
in  isJavaBased 
)

ISFILE returns true if a specified name corresponds to an existing file.

*  Input:
*    regular:
*        fileName: char[1,] - file name to check
* 
*    optional:
*        isJavaBased: logical[1,1] - if true (default), Java-based
*            implementation is used and Matlab implementation - otherwise.
*  Output:
*    isPositive: logical[1,1] - true if the file exists
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ listdirsrecursive()

function mxberry::io::listdirsrecursive ( in  dirName,
in  patternStr,
in  maxDepth 
)

LISTDIRSRECURSIVE returns a list of directories with names matching a specified pattern in all the subdirectories of a directory up to the specified depth.

*  Input:
*    regular:
*        dirName: char[1,] - directory name to scan
* 
*        patternStr: char[1,] - either Glob expression with "glob:" prefix
*            ("glob:**.m" for instance) or Regex expression with "regex:"
*            prefix.
*              -------Glob syntax description--------
*              *.txt    Matches all files that has extension as txt.
*              *.{html,htm} Matches all files that has extension as
*                html or htm. { } are used to group patterns and ,
*                comma is used to separate patterns.
*              ?.txt    Matches all files that has any single charcter as
*                name and extension as txt.
*              *.*  Matches all files that has . in its name.
*              C:\\Users\\* Matches any files in C: "Users" directory
*                in Windows file system. Backslash is used to escape a
*              special character.
*              /home/** Matches /home/foo and /home/foo/bar on UNIX
*                platforms. ** matches strings of characters corssing
*                directory boundaries.
*              [xyz].txt    Matches a file name with single character "x"
*                or "y" or "z" and extension as txt. Square brackets [ ]
*                are used to sepcify a character set.
*              [a-c].txt    Matches a file name with single character "a" or
*                "b" or "c" and extension as txt. Hypehen ÿ is used to
*                specify a range and used in [ ]
*              [!a].txt Matches a file name with single character that
*                is not "a". ! is used for negation.
* 
*        maxDepth: double[1,1] - maximum depth, use Inf means for no depth
*            liminations
*  Output:
*    dirNameList: cell[nFiles,1] of char[1,] - resuling list of directories
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ listfilesrecursive()

function mxberry::io::listfilesrecursive ( in  dirName,
in  patternStr,
in  maxDepth 
)

LISTFILESRECURSIVE returns a list of files with names matching a specified pattern in all the subdirectories of a directory up to the specified depth.

*  Input:
*    regular:
*        dirName: char[1,] - directory name to scan
* 
*        patternStr: char[1,] - either Glob expression with "glob:" prefix
*            ("glob:**.m" for instance) or Regex expression with "regex:"
*            prefix.
*              -------Glob syntax description--------
*              *.txt    Matches all files that has extension as txt.
*              *.{html,htm} Matches all files that has extension as
*                html or htm. { } are used to group patterns and ,
*                comma is used to separate patterns.
*              ?.txt    Matches all files that has any single charcter as
*                name and extension as txt.
*              *.*  Matches all files that has . in its name.
*              C:\\Users\\* Matches any files in C: "Users" directory
*                in Windows file system. Backslash is used to escape a
*              special character.
*              /home/** Matches /home/foo and /home/foo/bar on UNIX
*                platforms. ** matches strings of characters corssing
*                directory boundaries.
*              [xyz].txt    Matches a file name with single character "x"
*                or "y" or "z" and extension as txt. Square brackets [ ]
*                are used to sepcify a character set.
*              [a-c].txt    Matches a file name with single character "a" or
*                "b" or "c" and extension as txt. Hypehen ÿ is used to
*                specify a range and used in [ ]
*              [!a].txt Matches a file name with single character that
*                is not "a". ! is used for negation.
* 
*        maxDepth: double[1,1] - maximum depth, use Inf means for no depth
*            liminations
*  Output:
*    fileNameList: cell[nFiles,1] of char[1,] - resuling list of files
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ mkdir()

function mxberry::io::mkdir ( in  dirName)

MKDIR creates a directory recursively.

*  Input:
*    regular:
*        dirName: char[1,] directory name
* 
*  Output:
*    isSuccess: logical[1,1] - if true, execution was successful
*    msgStr: char[1,] - string containing the warning or error message
*        if operation is unsuccessful, empty otherwise
*    messageId: char[1,] - string containing the warning or error message id
*        if operation is unsuccessful, empty otherwise
* 
*  Note: tha main difference from the built-in mkdir function is that this
*    function works with long file names on Windows
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ rmdir()

function mxberry::io::rmdir ( in  dirName,
in  sFlag 
)

RMDIR removes a directory (optionally recursively)

*  Input:
*    regular:
*        dirName: char[1,] directory name
*    optional:
*        sFlag: char[1,1] - can only take 's' value, if sFlag is specified
*            the directory is removed with all subfolders and files. If the
*            flag is not specified the function expects an empty directory
* 
*  Output:
*    isSuccess: logical[1,1] - if true, execution was successful
*    msgStr: char[1,] - string containing the warning or error message
*        if operation is unsuccessful, empty otherwise
*    messageId: char[1,] - string containing the warning or error message id
*        if operation is unsuccessful, empty otherwise
* 
*  Note: tha main difference from the built-in rmdir function is that this
*    function works with long file names on Windows
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om