This file describes syntax of 24U SimpleFile Plug-In's functions.
SFile_Version ( { versionFormat } )
Returns version string of the active 24U SimpleFile Plug-In, formated as requested by the parameter. Use:
"short" to get just the version number "long" to get the plug-in name followed by its version number "platform" to get the platform of the code currently running
SFile_Register ( registrationCode )
Attempts to unlock (register) your copy of 24U SimpleFile Plug-In with the specified code. If the code is valid, 24U SimpleFile Plug-In gets unlocked and stays in this state until you quit the FileMaker application, deactivate the plug-in, or the registration code expires. While unlocked, 24U SimpleFile Plug-In is fully functional and does not bother the user with a shareware reminder.
Returns a non-zero result when operation is not permitted.
SFile_New ( fileSpec { ; itemKind } )
Creates new folder (default) or empty file with the specified fileSpec.
fileSpec any supported file specification itemKind "file" | "folder"
Returns: 0 if no error, Mac error code if item could not be created.
SFile_Delete ( fileSpec )
Deletes specified file or folder, recursively if it is not empty.
fileSpec any supported file specification
Returns: 0 if no error, Mac error code if item could not be deleted.
SFile_Copy ( sourceFileSpec ; targetFileSpec )
Duplicates specified file, or folder including all contents.
If targetFileSpec specifies an existing folder, source item is copied
into the target under the source's original name. If targetFileSpec
specifies a non-existing item in an existing folder, the source item
is copied under new name specified by the targetFileSpec. Fails if
target item already exists (error -48).
sourceFileSpec any supported file specification targetFileSpec any supported file specification
Returns: 0 if no error, Mac error code if item could not be duplicated.
SFile_Move ( sourceFileSpec ; targetFileSpec )
Moves or renames specified file or folder. If targetFileSpec specifies
an existing folder, source item is moved into the target under the source's
original name. If targetFileSpec specifies a non-existing item in an
existing folder, the source item is moved and renamed to a new name
specified by the targetFileSpec. If the second parameter is not a valid
file specification it si considered being plain file name alone and the
source item is just renamed. Fails if target item exists (error -48),
or if the target item's volume is different from the source item's volume
(error -1303).
sourceFileSpec any supported file specification targetFileSpec any supported file specification
Returns: 0 if no error, Mac error code if item could not be moved/renamed.
SFile_Choose ( itemKind )
Displays a system dialog for choosing an existing file or folder, or
a destination and name for a new file.
itemKind "file" | "folder" | "new"
Returns: file specification of choosen item or -128 if user canceled the dialog or
Mac error code if an error prevented displaying the dialog.
SFile_Read ( fileSpec { ; startIndex { ; maxLength } } { ; encoding } )
Reads file or folder's contents.
fileSpec any supported file specification startIndex 1-based index to start reading from maxLength maximum number of elements to read encoding "default" | "hex-dump" | "utf-16" | "utf-8" | "dos" | "x-mac-roman" | "windows-1252" | "euc-jp" | "euc-kr" | "gb2312" | "iso-8859-1" | "iso-8859-15" | "iso-8859-2" | "iso-8859-3" | "iso-8859-4" | "iso-8859-5" | "iso-8859-6" | "iso-8859-7" | "iso-8859-8" | "iso-8859-9" | "johab" | "windows-1250" | "windows-1251" | "windows-1253" | "windows-1254" | "windows-1255" | "windows-1256" | "windows-1257" | "x-mac-arabic" | "x-mac-centraleurroman" | "x-mac-chinesesimp" | "x-mac-chinesetrad" | "x-mac-cyrillic" | "x-mac-greek" | "x-mac-hebrew" | "x-mac-japanese" | "x-mac-korean" | "x-mac-turkish" | "image" | "file" | "text" |
Returns: return-delimited list of items in the specified folder or
contents of the speficied file or
"" if the folder/file is empty, or if we try to read past the end
Mac error code if the function fails for some reason.
Notes: For UTF-16, startIndex and maxLength point to Unicode
characters. For all other encodings, startIndex and
maxLength are measured in bytes.
For "default" or omitted encoding parameter, current platform's
native encoding is used.
For "hex-dump", hexadecimal bytes are separated by space, groups
of 16 bytes are separated by line breaks.
New "encoding" parameter types can be used:"image","file" and "text".
These encodings behaves as MIME types.
"image" type can be more specific:
"image/png", "image/gif", "image/jpeg", "image/tiff", "image/x-pict" for
macintosh pict format and "image/bmp" for windows bitmap format.
Using specific type will overide internal type recognization based on file
extension.
If "image" type is specified (without beeing more specific) and input file type
is not an image, file will be loaded as "file" type.
"file" can be used for any ordinary binary file which shoud be loaded into a
container. It has no subtypes.
File will be loaded into the container without any type recognization -
i.e. if it is jpeg image it will not be shown. Use "image" type instead.
"text" stands for text file encoded in default system 8 bit encoding.
This is the default when encoding parameter is not used.
SFile_Write ( fileSpec ; data { ; startIndex } { ; encoding } )
Writes data to the specified file. If the file does not exist, it is
created.
fileSpec any supported file/folder specification data any supported data format of FileMaker container startIndex -1 to append to the file, 0 to replace the file with a new contents, 1-based index to start writing from (overwriting original contents) encoding same encodings as supported by SFile_Read
Returns: 0 if no error, Mac error code if write failed.
Notes: For the "hex-dump" encoding, all white spaces are ignored and
other characters ouside the [0-1A-Fa-f] range are considered bad
and result in parameter error (-50) returned.
Parameter "StartIndex" is used only if it have any meaning (for ordinary files).
Parameter "encoding" is not used for binary files. Binary files are written in
the same type as they were read.
SFile_Get( selector { ; additionalData } )
Returns current value of a global variable or a file/folder attribute
specified by selector.
SFile_Get( "kind" ; fileSpec ) Returns "file" if the path specifies an existing file "folder" if the path specifies an existing folder Mac error code if item does not exist or another error occured.
Notes: aliases and Unix symbolic links are considered files, disk volumes and Mac OS X package bundles are considered folders.
SFile_Get( "created" ; fileSpec ) Returns item's creation date & time as timestamp SFile_Get( "modified" ; fileSpec ) Returns item's modification date & time as timestamp SFile_Get( "size" ; fileSpec ) Returns item's total size in bytes. SFile_Get( "data-size" ; fileSpec ) Returns item's data fork size in bytes. SFile_Get( "resource-size" ; fileSpec ) Returns item's resource fork size in bytes. SFile_Get( "available-space" ; fileSpec ) Returns available space in bytes on the disk where fileSpec belongs to. SFile_Get( "owner" ; fileSpec ) Returns item's owner. SFile_Get( "group" ; fileSpec ) ) Returns item's group. SFile_Get( "owner-rights" ; fileSpec ) Returns item's owner access rights in Unix syntax. SFile_Get( "group-rights" ; fileSpec ) Returns item's group access rights in Unix syntax. SFile_Get( "everyone-rights" ; fileSpec ) Returns item's access rights in Unix syntax.
SFile_Get( fileSpecKind ; fileSpec ) Returns fileSpec converted to another supported kind of file specification.
fileSpecKind "FSSpec" | "native-relative" | "native-full" | "win-relative" | "win-full" | "unix_relative" | "unix-full" | "FileMaker" | "URL"
Returns: Mac error code if failed.
SFile_Set( selector { ; fileSpec } ; newValue )
Modifies value of a global variable or a file/folder attribute specified
by selector.
SFile_Set( "created" ; nativeFullPath ; timeStamp ) Modifies file/folder's creation data & time. SFile_Set( "modified" ; nativeFullPath ; timeStamp ) Modifies file/folder's modification data & time.
Returns: 0 if successfull, Mac error code if failed.
SFile_Set( "owner" ; nativeFullPath ; ownerName ) Modifies item's owner. SFile_Set( "group" ; nativeFullPath ; groupName ) Modifies item's group. SFile_Set( "owner-rights" ; fileSpec ; accessRights ) Modifies item's owner access rights, expecting Unix syntax. SFile_Set( "group-rights" ; fileSpec ; accessRights ) Modifies item's group access rights, expecting Unix syntax. SFile_Set( "everyone-rights" ; fileSpec ; accessRights ) Modifies item's access rights, expecting Unix syntax.
Returns: 0 if successfull, Mac error code if failed.