Overview
:
*
Note: In Showmaster, the local disk access is restricted to a folder called "UserData", located in the project folder,
and the access to folders on the network is restricted to the folders shared without login and password.
FilesManagement
MxM provides a simple way to copy, move or erase any kind
of files on hard disk.
It also provides commands for reading and writing files.
The directory where mxmFilesManagement works can be on the
local disk or on any accessible disk over the network.
Directories can also be created and their contents can be listed.
A special command lets you change the attribute of files
(like their readonly flag).
A serie of commands is provided for manipulating strings,
for the purpose of saving and sorting, arrangement of strings
in blocks, refinding of strings from blocks. For example,
these commands are practical for managing and saving tables
of ascii text strings.
Special commands are provided for managing INI files : ini
files are very practical for creating simple database files.
They contains sections and items. Folowing is an example
of a simple INI file called "Addresses.INI" where names
of people are into sections and their address are in items.
[Jack Ripper]
Address = Knife street 13
City = Manchester
Zip code = 123456
[Maria Rabbit]
Address = Carrot street 4
City = New York
Zip code = 654321
[César Escartefigue]
Address = 5 rue des Pacoulins
City = Manosque
Zip code = 010203
In this example, you can read back the address of Maria
Rabbit into a variable called Adr with the FilesManagement
command :
Read items from section ( "Addresses.INI", "Maria Rabbit",
"Address", Adr).
Other commands let you create new sections and items.
You can also list all the sections of a file and all the
items of a section.
With
mxmFilesManagement, you can also monitor changes in a folder ( * not available in Showmaster).
WARNING : the monitor command checks for changes in the
folder specified AND into the sub-folders. So if there is
a big quantity of files in these folders and subfolders,
the refresh of monitoring files list can be very slowed
down.
> Top
Installation
(MXM) :
No
special installation required
> Top
Creation
(Device) :
No
setup dialog box at creation
> Top
Commands
(List Of) :
The
commands marked with *
are not available in Showmaster.
Set
current directory :
Description
: Set the current working directory.
Parameters :
Path [Type : String] : New directory path.
Get subdirectories list :
Description
: Get the list of the sub-directories present in the current
directory.
Parameters :
Return list [Type : String] : Variable that will
contain the list in return.
Usage : The return variable is a list of strings.
It can be the 'text' property of a list object in a Manager
or Display Controller user-screen.
Get fileslist :
Description
: Get the list of files present in the current directory.
Parameters :
Return list [Type : String] : Variable that will
contain the list in return.
Usage : The return variable is a list of strings.
It can be the 'text' property of a list object in a Manager
or Display Controller user-screen.
Copy file :
Description
: Copy a file from a directory to another directory.
Parameters :
Source path [Type : String] : Full name of the
file to copy.
Destination path [Type : String] : Full name of
the destination file (can be a new name).
Move/rename file or directory :
Description
: Move a file from a directory to another directory.
Parameters
Source path [Type : String] : Full name of the
file to move or rename
Destination path [Type : String] : Full name of
the destination.
Usage : this command is called "Move/rename"
because if you specify a different directory for destination,
it is a move and if you specify the same directory as
the source, it is a renaming. This command apply to directories,
but in this case it only renames.
WARNING : if the destination file exists, the function
fails, you must call "delete file" then "move
file" in that case.
Delete file :
Description
: Delete a file from the current directory.
Parameters :
Path [Type : String] : Full name of the file to
delete.
Write string to file :
Description
: Write a string in a file.
Parameters :
File path [Type : String] : Full name of the file
to write.
String [Type : String] : String to write.
Usage : If the file does not exist, it is created.
If the file exists, its previous contents is erased and
replaced with the new string.
Read String from File :
Disk Free* :
Description
: Return the available free space of a disk.
Parameters :
Drive letter [Type : String] : Letter of the drive.
Return size [Type : Integer] : Variable filled
with size of free space in KBytes in return.
File size :
Description
: Return the size of a file.
Parameters :
File name [Type : String] : Full name of the file.
Return size [Type : Integer] : Variable filled
with the size of the file in bytes in return.
Force create directories :
Description
: Create a new directory in the current directory.
Parameters
Path [Type : String] : Name of the directory.
Usage : Multiple path can be specified, path like
Dir1\Dir2\Dir3 are allowed.Relative path (Dir1\Dir2) or
full path (C:\Dir1\Dir2) can be used.
Read sections from ini :
Description
: List all the sections of the specified INI file.
Parameters :
Ini file name [Type : String] : Full name of the
ini file.
Return sections list [Type : String] : Variable
that will contain the list of sections in return.
Usage : The return variable is a list of strings.
It can be the 'text' property of a list and the sections
names can then be accessed with the list control commands
of Manager or Display Controller.
Read items from section :
Description
: List all the items of the specified section of a INI
file.
Parameters :
Ini file name [Type : String] : Full name of the
ini file.
Section name [Type : String] : Name of the section.
Return items list [Type : String] : Variable that
will contain the list of items in return.
Usage : The return variable is a list of strings.
It can be the 'text' property of a list and the items
names can then be accessed with the list control commands
of Manager or Display Controller.
Read item value :
Description
: Read the value of the specified item.
Parameters :
Ini file name [Type : String] : Full name of the
ini file.
Section name [Type : String] : Name of the section
to read from.
Item name [Type : String] : Name of the item to
read from.
Return item value [Type : String] : Variable that
will contain the value of the item in return.
Write item value :
Description
: Write the value of the specified item.
Parameters :
Ini file name [Type : String] : Full name of the
ini file.
Section name [Type : String] : Name of the section
to write to.
Item name [Type : String] : Name of the item to
write to.
Item value [Type : String] : Value to write.
Usage : If the INI file does not exist, it is created.
If the section does not exist, it is created. If the item
does not exist, it is created, otherwise its value is
changed to the new value.
Erase section:
Set file attributes :
Description
: Change the attributes of the specified file.
Parameters :
Read only [Type : Enum] : Read only flag
Available
values :
"On"
"Off"
Hidden
[Type : Enum] : Hidden flag
Available
values :
"On"
"Off"
Usage
: Wildcards are allowed : for example, *.* will change
the attributes of all the files in the current directory,
*.txt will change the attributes of all the text files
in the current directory. Useful when files are copied
from a Cd-Rom where they have the read-only flag.
Open file dialog* :
Description
: Open the default browser window dialog.
Parameters :
Type [Type : Eum] : The type of dialog : Open or
Save.
Title [Type : String] : The title of the dialog.
Filter [Type : String] : For filtering files by
extension.
Initial directory [Type : String] : The directory
on which the window opens.
Usage : If the user selects a file, the name of
the file is contained in the variable CurrentFile.
If the user choose Cancel, the variable CurrentFile
is empty.
WARNING : this dialog is modal, that means
that as long as the dialog is opened, no other command
can be performed by the same device (but others devices
works, even other FilesManagement devices).
Split file path :
Description
: Split the name of a file into 3 parts : directory, file
name, and extension.
Parameters :
Full path name [Type : String] : The path of the
file
Return directory [Type : String] : The string that
will contain the directory in return.
Return filename [Type : String] : The string that
will contain the file name in return.
Return extension [Type : String] : The string that
will contain the extension in return.
Directory
monitoring* :
Description
: Specify the directory to watch. All changes in that
directory will be monitored in the monitoring variables
ot this device (see variables).
Parameters :
Directory [Type : String] : The directory to watch.
Clear
modified files list* :
Description
: Clear all the names listed in the MonitoringModifiedFiles
variable.
Parameters :
No parameters.
Clear
new files list* :
Description
: Clear all the names listed in the MonitoringNewFiles
variable.
Parameters :
No parameters.
Clear
deleted files list* :
Description
: Clear all the names listed in the MonitoringDeletedFiles
variable.
Parameters :
No parameters.
Copy/move
directory :
Description
: Copy or move the files specified from a directory and
from its subdirectory to another directory.
Parameters :
Source path [Type : String] : Full name of the
directory to copy.
Destination path [Type : String] : Full name of
the destination directory.
Filter [Type : String] : Filter the files to copy.
Action [Type : Enum] : Action can be COPY or MOVE.
Usage : If
destination directories don't exist, they are created.
If the default filter *.* is not used, only the specified
files are copied. When the action is MOVE, all the files
specified are moved and the left empty directories of
the source are removed.
Delete
directory :
Description
: Delete the directory and all its files and subdirectories.
Parameters :
Directory [Type : String] : Full name of the directory
to delete.
With confirmation [Type : Enum] : Display a confirmation
dialog : YES or NO.
Move to recycle bin[Type : Enum] : Move all the
files to the recycle bin: YES or NO.
WARNING : If the two enums are set to NO,
all the files are erased without confirmation and without
undo. By default, the enums are set to YES.
Get
file information :
Description
: Retreive informations from a file.
Parameters :
File path[Type : String] : Full name of the file.
Info type[Type : Enum] : Type of information
: "File Version", "Company Name", "File Description",
"Internal Name", "Legal Copyright", "Original Filename",
"Product Name", "Product Version".
Return info [Type : String] : The string that
will contain the information in return.
NOTE : If the info is not in the file the string
returns "Info not found", if the files doest
not exist the string returns "File not found".
Erase
item from section:
Description
: Erase totally the specified item.
Parameters :
Ini file name [Type : String] : Full name of the
ini file.
Section name [Type : String] : Name of the section.
Item name [Type : String] : Name of the item to
erase.
> Top
Variables
(List Of) :
CurrentDirectory
:
Type
: String.
Description : Current directory.
LastError :
Type
: Enum
Description : Error message (result of the last command).
Available values :
"No Error"
"Error"
CommandStatus
:
Type
: Enum
Description : Satus of the running command.
Available values :
"Done"
"Running"
Usage : This command was useful in the version
1.0 of Manager or Display Controller, in order to be sure
that the command has finished, but now it is obsolete
because the task calling this command will be blocked
the time the command will be done (and not the other tasks).
WindowsDirectory*
:
Type
: String
Description : Current Windows (OS) directory.
SystemDirectory*
:
Type
: String
Description : Current System (OS) directory.
ProjectsDirectory*
:
Type
: String.
Description : Manager or Display Controller current
projects directory.
CurrentFile*
:
Type
: String
Description : The file selected by the "Open file
dialog" command. The string is empty if the user closes
the dialog by clicking on the cancel button.
MonitoringModifiedFiles*
:
Type
: String
Description : List of all the files modified in
the monitored directory.
MonitoringNewFiles*
:
Type
: String
Description : List of all the new files in the
monitored directory.
MonitoringDeletedFiles*
:
Type
: String
Description : List of all the files deleted in
the monitored directory.
MonitoringStatus*
:
Type
: Enum
Description : Status of the monitoring command.
Available values : Directory not found
(wrong directory)
Waiting for changes
(monitoring)
Searching files changed (change signaled)
> Top
Support
(Difference with previous versions) :
V 1.0.1:
V 1.1.0:
- Added: Support for Showmaster ST & Pro.
- Fixed: "Copy/Move Directory" with MOVE option doesn't make a MOVE but a COPY.
- Fixed: "Copy/Move Directory" doesn't create the root destination directory if not exists as per described in the Help file.
- Fixed: "The device Current" Directory is reset to the Windows Current Directory each time the device starts. It should be done only if the device Current Directory is not yet set..
- Fixed: "Set File Attribute" doesn't work..
- Fixed: "Open file dialog" doesn't open in the correct initial directory if the given path is relative to the Current Directory.
- Fixed: "Directory Monitoring" doesn't work with relative path.
V 1.1.1:
- Fixed: "'Get File Info' always returns 'File not found' under Showmaster.
> Top
|