24U SimpleFile Plug-In 2.0 Syntax

SFile_Version( { versionFormat } )

Returns version string of the active 24U SimpleFile Plug-In, formatted as requested by the parameter.

Parameters

versionFormatDefines the format of the returned version.

Parameter values for versionFormat

"short"To get just the version number. Default value.
"long"To get the plug-in name followed by its version number
"platform"To get the platform of the code currently running
"autoupdate"To get autoupdate compatible (comparable) version number.

Description

This function is very important and it has the same output format in all 24U Plug-Ins. You should call this function every time you need to check if the plug-in is properly installed to the FileMaker. Even if the plug-in is not registered (or badly registered) this function should work. Calling this function in the startup script of your solution is recommended.

Result

Returns requested version format or platform. If this function returns "?" than the plug-in is not properly installed or FileMaker cannot load and activate it for some reason.

Examples

SFile_Version( "long" )
This will return the plug-in name and its version. In this case it is "24U SimpleFile Plug-In 2.0".

SFile_Version( "platform" )
Returns "Mac OS X" or "Windows" depending on the platform the plug-in is currently running.

SFile_Version( "autoupdate" )
Returns "02030400" for the plug-in version 2.3.4.

SFile_Register( originalSerialNumber { & " " & upgradeSerialNumber... } )

Attempts to unlock (register) your copy of 24U SimpleFile Plug-In with the specified code.

Parameters

originalSerialNumberThe original (non upgrade) code to unlock the full version of the plug-in.
upgradeSerialNumberThe upgrade code to unlock the full version of the plug-in.

Description

If the code(s) is valid, 24U SimpleFile Plug-In gets unlocked and stays in this state until you quit the FileMaker Pro 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.

Result

Returns a non-zero error code when the serial numbers are wrong if the numbers cannot be used. Returns 0 if the plug-in was successfully registered.

Examples

SFile_Register( "SFI10J-CM244H-U4UGBN" )
This function will register the plug-in with serial number SFI10J-CM244H-U4UGBN. This method is useful when you register the plug-in with developer license but it can be used for end-user licenses as well.

SFile_Register( "SFI10J-CM244H-U4UGBN SFI20J-BTPDSK-D3AJ9C" )
Use combination of serial numbers delimited by empty space to register using upgrade code. The first code must be the original one, all other codes should be upgrade codes.

SFile_Register( "SFI10J-CM244H-U4UGBN SFI20J-BTPDSK-D3AJ9C SFI30J-5B4J7Z-W9KFNS" )
The example of using one original number and two upgrade numbers. The original is for version 1.0 and upgrades are for 2.0 and 3.0.

Note: All serial numbers here are only for demonstration purposes. They will not work in real plug-in.

SFile_Choose( itemKind )

Displays a system dialog for choosing an existing file or folder or a destination for a new file.

Parameters

itemKindThis can be: "file" to choose one existing file, "folder" to choose one existing folder and "new" to open system dialog with new file (Save As dialog). You can also use: "files" to choose multiple existing files, "folders" to choose multiple existing folders (only on Mac OS X).

Description

Use this function to invoke operating system dialog to Open or Save file or folder.

Result

Function returns a value list of native full paths chosen by the user. If user clicks cancel button the function returns -128. In the case of error the function returns negative error code.

Examples

SFile_Choose( "new" )
Function invokes "Save As..." dialog where you can specify the name of the new file or folder.

SFile_New( path { ; itemKind } )

Creates new folder (default) or empty file on the specified path.

Parameters

pathThe path to new file or folder. To see valid path type look go to: Paths in SimpleFile
itemKindSpecifies what can be created. Can be either "folder" (default) or "file".

Description

Use this function to create the new file or folder. If the file / folder already exists error -48 is returned and no new item is created. Using SFile_Choose( "new" ) is recommended to obtain valid path.

Result

Function returns 0 if file or folder was created. Otherwise it returns negative error code.

Examples

SFile_New( "C:\\Users\\me\Documents\\TextFile.txt" ; "file" )
This will create a new text file in Documents folder of the user "me" in Windows Vista or 7.

SFile_New( "/Users/me/Documents/NewFolder" ; "folder" )
This will create a new folder "NewFolder" in Documents folder of user "me" on Mac OS X.

SFile_New( "Log.txt" ; "file" )
This will create a new file named "Log.txt" on the same folder where current active FileMaker solution is.

SFile_Delete( path )

Deletes specified file or folder, recursively if it is not empty.

Parameters

pathThe path to existing file or folder. To see valid path type look go to: Paths in SimpleFile

Description

This function deletes specified existing file or folder. It can be very dangerous if misused - it recursively deletes folders. The function does not follow symbolic links however. It uses operating system functions so the file or folder will be moved to Trash and not deleted irreversibly.

Result

Function returns 0 if the file or folder was deleted. Otherwise it returns negative error code.

Examples

SFile_Delete( "C:\\Users\\me\\Documents\\OldNastyFile.doc" )
The file "OldNastyFile.doc" in path "C:\Users\me\Documents" will be deleted in Windows.

SFile_Delete( "/Users/me/WrongScript.command" )
The script file "WrongScript.command" in path "/Users/me" will be deleted in Mac OS X.

SFile_Delete( "Something" )
The item named "Something" will be deleted. The plug-in tries to find file or folder named "Something" in the same folder as currently running FileMaker solution. If it finds file or folder it will delete it.

SFile_Copy( sourcePath ; targetPath )

Duplicates specified file, or folder including all contents.

Parameters

sourcePathThe path to source file or folder. To see valid path types go to: Paths in SimpleFile
targetpathThe path to destination file or folder

Description

If targetPath specifies an existing folder, source item is copied into the target under the source's original name. If targetPath specifies a non-existing item in an existing folder, the source item is copied under new name specified by the targetPath. Fails if target item already exists (error -48).

Result

Function returns 0 if the item was duplicated. Otherwise it returns negative error code.

Examples

SFile_Copy( "C:\\Users\\me\\Documents\\OldNastyFile.doc" ; "C:\\Users\\you\\Documents\\NewNiceFile.doc" )
Duplicates "OldNastyFile.doc" to the new file "NewNiceFile.doc".

SFile_Copy( "pictures/BigPicture.jpg" ; "/Volumes/ImgVolume" )
The file "BigPicture.jpg" stored in directory "pictures", which is in the same directory as the solution, will be copied into folder "/Volumes/ImgVolume".

SFile_Move( sourcePath ; targetPath )

Moves or renames specified file or folder.

Parameters

sourcePathThe path to source file or folder. To see valid path types go to: Paths in SimpleFile
targetPathThe path to destination file or folder

Description

If targetPath specifies an existing folder, source item is moved into the target under the source's original name. If targetPath specifies a non-existing item in an existing folder, the source item is moved and renamed to a new name specified by the targetPath. If the second parameter is not a valid path it is 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). In this case use SFile_Copy( sourcePath ; targetPath ) and SFile_Delete( sourcePath ) instead.

Result

Function returns 0 if the file or folder has been moved. Otherwise it returns negative error code.

Examples

SFile_Move( "FileWithBadName.dat" ; "FileWithGoodName.dat" )
This will rename the file with name "FileWithBadName.dat" to "FileWithGoodName.dat" in the current folder of the solution.

SFile_Move( "C:\\Temp\\game_config_backup.ini" ; "C:\\Game\\SomeGame\\GameConfig.ini" )
Move file "game_config_backup.ini" to the folder "C:\Game\SomeGame\" and rename it to "GameConfig.ini".

SFile_Move( "C:\\Temp\\game_config_backup.ini" ; "D:\\Game\\SomeGame\\GameConfig.ini" )
Will fail with -1303 because source and target volumes (drives) do not match.

SFile_Read( path { ; startIndex { ; maxLength } } { ; encoding } )

Reads file or folder content.

Parameters

pathPath to file in any supported form. To see valid path types go to: Paths in SimpleFile
startIndexSpecifies byte offset in file. The first byte of file is on offset 0. The negative number is counted from the end of the file: -1 is the last byte of file. The default value is 0.
maxLengthNumber of bytes to read from file. The default value is "all" which means that all bytes to the end of the file will be read.
encodingSpecifies text encoding for text file or file type for binary files. The default is "default" which means text file with system default encoding. To see all possible encodings go to Encodings list

Description

This is a universal reader of files and folders. It can read any file, text or binary and it can list the contents of the folder.

Result

The function returns bytes or characters read from the file. In the case of error the function returns "?" and error code is set. Use SFile_Get( "lastError" ) to obtain error code.

Examples

SFile_Read( "SomeText.txt" )
Read contents of the file "SomeText.txt" in the same directory as the solution. Plug-In uses default values, this means it presumes that: Encoding is default system (Mac-Roman on Mac, CP-1252 on Windows) and file type is Text.

SFile_Read( "SomeText.txt" ; 25 ; 1000 )
Similar to previous example. The plug-in will start reading from 25th byte of file and reads only 1000 bytes.

SFile_Read( "/Library/Preferences/Configuration.conf" ; 42 ; 80 ; "utf-8" )
This command will return the content of the file "Configuration.conf" from folder /Library/Preferences/. Data are from 42nd byte. It reads only 80 bytes and decode the text from utf-8 encoding.

SFile_Read( "file:///Library/Preferences/Configuration.conf" ; -80 ; 80 ; "utf-8" )
Very similar to previous example demonstrating another path type. It reads last 80 bytes in file and decode the text from utf-8 encoding.

SFile_Write( path ; data { ; startIndex } { ; encoding } )

Writes content to the file.

Parameters

pathPath to file in any supported form. To see valid path types go to: Paths in SimpleFile
dataFileMaker field containing data which should be written to file.
startIndexSpecifies byte offset in file. The first byte of file is on offset 0. The negative number is counted from the end of the file: -1 is the last byte of file. The default value is 0. All bytes from FileMaker rewrites the content of the file.
encodingSpecifies text encoding for text file or file type for binary files. Default values are listed in the next table. To see all possible encodings go to Encodings list

Default file encoding used in encoding parameter for data.

FileMaker Field TypeWritten file type
Text, Number, Date, Time, TimestampThe contents of the field is written to text file with default operating system encoding.
Container with general fileThe file is written to disk in an unchanged form.
Container with pictureThe picture will be written to file using the same type it is stored inside the container.
Container with soundThe sound file will be written to file using the same type it is stored inside the container.
Container with linkLinked file, if available, will be copied "as is" to the target path.

Description

Use this function to write to existing files or to create the new one. The function is able to write binary data from container but don't use it to convert binary data between formats. If you use SFile_Read to load jpg picture this function cannot convert it to gif for example.

Result

The function returns the number of bytes / characters which were actually written. In the case of error the function returns "?" and error code is set. Use SFile_Get( "lastError" ) to obtain error code.

Examples

SFile_Write( "C:\\Documents\\TextFile.txt" ; "Hello World!" )
This function will create (or rewrite) the file "TextFile.txt" to "C:\Documents" folder and it writes text "Hello World!" into this file using operating system default encoding.

SFile_Write( "notes.txt" ; "Interesting note" )
Writes text "Interesting note" into file "notes.txt" in the same directory as the solution.

SFile_Write( "/var/logs/log.txt" ; "09:31 - Something happened\n" ; -1 ; "utf-8" )
This will append the text "09:31 - Something happened" to the end of the file "log.txt" stored inside "/var/logs" and moves cursor to the next line in file. The text will be written using UTF-8 encoding.

SFile_Write( "picture.jpg" ; pictureContainer ; "image" )
Writes picture from container to file.

SFile_Write( "picture.jpg" ; fmTextField ; "hex-dump" )
Text in the text field must be in the hex-dump form, for example: "FE ED 03 DE AD 42 ...". The plug-in will process each hex number (two characters [0-9,A-F,a-f]) into binary file. All non-hex characters (white spaces, newlines etc...) are ignored.

SFile_Convert( sourcePath ; targetPath { ; name ; value } { ; name ; value } ... )

Converts various file formats and change its internal attributes.

Parameters

sourcePathThe path to source file. To see valid path types go to: Paths in SimpleFile
targetPathThe path to destination file.
nameThe name of the parameter to be altered. Available options depend on the file type.
valueDesired new value of the specified parameter.

Supported parameter names for file types.

File TypeParameterDescription
Picture"width"Function will change width of the picture.
Picture"height"Function will change height of the picture.
Picture"proportional"1 (default) to maintain aspect ratio when resizing picture, 0 to stretch. When both width and height are specified and propotional scaling is on, picture will be fitted to the rectangle specified by width and height.
Picture"exif-rotate"The destination picture will be hard rotated to direction specified in exif data of the source picture. If the source has no exif data, this parameter will be ignored.

Description

The file on sourcePath is read and recognized automatically. Plug-in version 2.0 supports only conversions listed above. More conversion can be added in the future version. If no conversion is necessary the file will be simply copied as is.

Result

The function returns 0 if if the conversion / copy has been successful. In the case of error the function returns non zero status code.

Examples

SFile_Convert( "bigPicture.jpg" ; "thumbnail.jpg" ; "height" ; 24 )
The "bigPicture.jpg" will be converted and saved to "thumbnail.jpg". The picture height will be changed to 24 pixels preserving aspect ratio.

SFile_Convert( "photograph.jpg" ; "thumbnail.jpg" ; "exif-rotate" ; 1 ; "width" ; 24 )
The "photograph.jpg" will be converted and saved to "thumbnail.jpg". The picture will be rotated according to exif meta data and than it will be resized so its width will be 24 pixels preserving aspect ratio.

SFile_Convert( "original.png" ; "deformed.png" ; "proportional" ; 0 ; "width" ; 120 ; "height" ; 120 )
The "original.png" will be resized to 120x120 pixels and saved to "deformed.png". Aspect ratio is not preserved.

SFile_Convert( "original.png" ; "not_deformed.png" ; "proportional" ; 1 ; "width" ; 120 ; "height" ; 120 )
The "original.png" will be resized to fit bounding box 120x120 pixels and saved to "not_deformed.png". Aspect ratio is preserved.

SFile_Open( path )

Opens the file or folder using the default application specified by operating system.

Parameters

pathThe path to file or folder which should be opened. See Paths in SimpleFile for the list of valid path types.

Description

Launches default application to open the file or folder on the path. Folders are opened in OS default File Manager.

Result

The function returns 0 if the file or folder has been successfully opened. In the case of error the function returns non zero status code.

Examples

SFile_Open( "picture.jpg" )
The picture.jpg should be placed in the same folder as the current active FileMaker solution. On Mac OS X this will probably call Preview.app which will show the file picture.jpg. On Windows the default picture viewer will be opened with the file.

SFile_Open( "." )
The dot points to current folder so current folder will be opened with the default file manager of the operating system (Finder on Mac OS X and Explorer on Windows).

SFile_Mount( URL { ; mountPath } { ; username ; password } )

Mounts network volume to specified mount point in file system.

Parameters

URLURL of the network volume. Use format default for each operating system. The plug-in is able to translate OS specific identifiers for Samba volumes: "smb://host" and "\\host" are interchangeable.
mountPathThe path to the directory where the user has right to mount network drive. When not specified, "/Volumes/ShareName" is used on Mac OS X and first available drive letter on Windows.
Note: The mounted volume may not appear on the user's desktop when non-default mount path is used.
See Paths in SimpleFile for the list of valid path types.
usernameOptional username. The default username is the username under which FileMaker Pro runs.
passwordOptional password. The default password is the password of user under which FileMaker Pro runs.

Description

This command will use OS capabilities to mount network volume to the file system. The user must have permissions to mount to specific mountPath.

Result

The function returns the full path to the newly mounted network disk. In the case of error the function returns "?" and error code is stored. Use SFile_Get( "lastError" ) to obtain the error code.

Examples

SFile_Mount( "\\fileserver.com\share" ; "Share" )
The plug-in will attempt to mount network volume "share" on host "fileserver.com" to the folder "Share" which must exist in the same folder as the active FileMaker solution. It uses current system username and password.

SFile_Open( "smb://fileserver.com/share" ; "Share" )
This command does the same as previous command. Both commands work the same on both platforms, Mac OS X and Windows. The plug-in internally translates URL types to be compatible with underlying OS.

SFile_Open( "http://fileserver.com/share" ; "Share" )
Attempts to mount WebDAV volume to the file system. This command will probably work only on Mac OS X. On Windows the plug-in tries to mount the drive and if Windows fails it returns error -35 (No such volume)

SFile_Unmount( mountPath )

Unmounts mounted volume from the filesystem.

Parameters

mountPathThe path to the mounted directory. See Paths in SimpleFile for the list of valid path types.

Description

This command will use OS capabilities to unmount volume from the file system. The user must have permissions to unmount the specific mountPath.

Result

The function returns 0 if the volume has been successfully unmounted or non-zero error code in the case of failure.

Examples

SFile_Unmount( "Share" )
This will unmount mounted volume "Share" in the same folder as current active FileMaker solution.

SFile_Unmount( "/Volumes/NetworkDrive" )
This will unmount mounted volume on absolute path "/Volumes/NetworkDrive" on Mac OS X. On Windows it tries to unmount directory "C:\Volumes\NetworkDrive" and if it does not find such a directory it returns error -43.

SFile_Unmount( "N:" )
This will unmount mounted volume "N:" on Windows. On Mac OS X it tries to unmount folder named "/Volumes/N". It returns -43 if no such folder exists.

SFile_Get( selector { ; path } { ; parameter } )

Gets important internal parameters of the plug-in and information about storage system.

Parameters

selectorThe name of the parameter which should be get.
pathThe path to file in supported form. See Paths in SimpleFile for the list of valid path types.

Parameter values for selector

selectorDescription
"lastError"Returns the status code of the last performed plug-in function.
"lastErrorMessage"Returns description of the last error generated by the plug-in.
"type"The Parameter should be FileMaker container. Returns type of the contents of FileMaker container. See List of recognized container types below.
"kind"Returns "file" if the path specifies an existing file "folder" if the path specifies an existing folder. Symbolic links are considered as files and Mac OS X volumes as folders. Returns error if the object does not exist.
"created"Returns item's creation date & time as timestamp.
"modified"Returns item's modification date & time as timestamp.
"size"Returns item's total size in bytes. For directory it sums up all file sizes in the directory and subdirectories.
"data-size"Returns item's data fork size in bytes. The same as "size" on Windows. For directory it sums up all file data sizes in the directory and subdirectories.
"resource-size"Returns item's resource fork size in bytes. Returns 0 on Windows. For directory it sums up all file resource sizes in the directory and subdirectories.
"available-space"Returns available space in bytes on the volume where path points to.
"owner"Returns item's owner.
"group"Returns item's group.
"owner-rights"Returns item's owner access rights.
"group-rights"Returns item's group access rights.
"everyone-rights"Returns item's access rights.
pathTypeConverts path from one type to another. See below for the list of supported path types.
pathTypeDescription
"fsspec"Returns Macintosh fsspec. This is unique file or folder identifier used in old Mac OS. Today it is obsolete. The format is: "fsspec:VolumeID:FolderID:FileName". On Windows the FileName contains full path to the file and VolumeID and FolderID are 0.
"native-relative"Relative path in the form native to the system. The same as "win-relative" on Windows and "unix-relative" on Mac OS X.
"native-full"Full path in the form native to the system. The same as "win-full" on Windows and "unix-full" on Mac OS X.
"win-relative"Relative path in the form native to Windows. The backslash is used as a separator.
"win-full"Full path in the form native to Windows. Unix paths are converted by changing slashes to backslashes and by adding "C:" before the path.
"unix-relative"Relative path in the form native to Unix. The slash is used as a separator.
"unix-full"Full path in the form native to Unix. To convert Windows path, volume identifier is removed, backslashes changed to slashes.
"FileMaker"Full local path in the form native to FileMaker Pro.
"URL"Full local path in the URL form. The plug-in tries to conform to conventions of underlying operating system.

Description

Use this function to get important parameters of files, folders and system settings.

Result

The function returns actual value of the parameter. In the case of error the function returns "?" and error code is set. Use SFile_Get( "lastError" ) to obtain error code.

Examples

SFile_Get( "created" ; "C:\\Windows" )
Returns the date and time when the Windows folder was created (probably the time when Windows was installed).

SFile_Get( "available-space" ; "D:\\" )
Returns the number of free bytes available on disk D: on Windows.

SFile_Get( "owner-rights" ; "/Users/me/Documents/myDocument.pages" )
Returns "read|write|delete" if you are owner of this bundle / file.

SFile_Get( "type" ; pictureContainer )
Returns "PNGf" if the container has a picture which has been initially loaded from png picture file.

SFile_Get( "FileMaker" ; "/Users/Pete/file.txt" )
Returns "file:/Macintosh HD/Users/Pete/file.txt" on Mac OS X if the system disk is named "Macintosh HD". On Windows it returns "file:/C:/Users/Pete/file.txt" if system disk is C:.

SFile_Get( "FileMaker" ; "C:\\Users\\Pete\\file.txt" )
Returns "file:/Macintosh HD/Users/Pete/file.txt" on Mac OS X if the system disk is named "Macintosh HD". On Windows it returns "file:/C:/Users/Pete/file.txt".

SFile_Get( "native-full" ; "/Users/Pete/file.txt" )
Returns "/Users/Pete/file.txt" on Mac OS X. On Windows it returns "C:\Users\Pete\file.txt".

SFile_Get( "native-full" ; "C:\\Users\\Pete\\file.txt" )
Returns "/Users/Pete/file.txt" on Mac OS X. On Windows it returns "C:\Users\Pete\file.txt".

SFile_Get( "win-full" ; "/Users/Pete/file.txt" )
Returns "C:\Users\Pete\file.txt" on both platforms.

SFile_Get( "URL" ; "/Users/Pete/file.txt" )
Returns "file:///Users/Pete/file.txt" on both platforms.

SFile_Get( "URL" ; "C:\\Users\\Pete\\file.txt" )
Returns "file:///Users/Pete/file.txt" on Mac OS X. On Windows it returns "file://C:/Users/Pete/file.txt"

SFile_Get( "native-full" ; "file.txt" )
Suppose the current active solution in FileMaker is placed in folder "/Users/Pete" on Mac OS X or "C:\Users\Pete" on Windows. The functions returns "/Users/Pete/file.txt" on Mac OS X. On Windows the returned value is "C:\Users\Pete\file.txt".

SFile_Get( "unix-full" ; "file.txt" )
Suppose the current active solution in FileMaker is placed in folder "/Users/Pete" on Mac OS X or "C:\Users\Pete" on Windows. The functions returns "/Users/Pete/file.txt" on both platforms.

SFile_Get( "native-full" ; "../Suzan/file.txt" )
Suppose the current active solution in FileMaker is placed in folder "/Users/Pete" on Mac OS X or "C:\Users\Pete" on Windows. The functions returns "/Users/Suzan/file.txt" on Mac OS X. On Windows the returned value is "C:\Users\Suzan\file.txt".

SFile_Set( selector ; path ; newValue )

Sets important internal parameters of the plug-in and information about storage system.

Parameters

selectorWhich data should be set.
pathThe file or folder which parameters should be changed. See Paths in SimpleFile for the list of valid path types.
newValueThe new value of the parameter.

Parameter values for selector

selectorDescription
"created"Sets the file creation date and time. Use FileMaker timestamp stored in newValue parameter.
"modified"Sets the file modification date and time. Use FileMaker timestamp stored in newValue parameter.
"owner"Sets the file owner. You must have the permission to change owner.
"group"Sets the file group. You must have the permission to change group.
"owner-rights"Sets the file permissions for owner. You must have the permission to change permissions.
"group-rights"Sets the file permissions for group. You must have the permission to change permissions.
"everyone-rights"Sets the file permissions for everyone. You must have the permission to change permissions.

Description

Use this function to set important parameters.

Result

The function returns actual value of the parameter. In the case of error the function returns "?" and error code is set. Use SFile_Get( "lastError" ) to obtain error code.

Examples

SFile_Set( "owner" ; "/Users/me/Documents/someFile.txt" ; "me" )
Changes file owner of the file on path "/Users/me/Documents/someFile.txt" to "me".

SFile_Set( "everyone-rights" ; "C:\\Documents and Settings\\me\\Documents\\someFile.txt" ; "read|write|delete" )
Everyone can read file, write to file and delete file "someFile.txt".

Paths in SimpleFile

SimpleFile accepts and converts many path types. Here are some examples of paths:

Path ExampleDescription
"C:\directory\file.ext"The Windows full path. Use this type on Windows when you want to specify the exact file or folder position. On Mac OS X SimpleFile tries to convert path to this form: "/directory/file.ext".
"/directory/file.ext"Standard unix full path. Use this type on Mac OS X to specify exact file or folder position. On Windows SimpleFile tries to convert the path to the form: "C:\directory\file.ext".
"directory\file.ext"The Windows relative path. Use this type to specify path to file or folder relatively to position of the active solution file. If you don't know where your solution will be located (i.e. on FileMaker Server) use full paths instead. On Mac OS X SimpleFile tries to convert this form to the unix one: "directory/file.ext".
"directory/file.ext"This is the unix relative path. Use this type to specify path to file or folder relatively to position of the active solution file. If you don't know where your solution will be located (i.e. on FileMaker Server) use full paths instead. On Windows SimpleFile tries to convert this form to the Windows one: "directory\file.ext".
"file:\volume\directory\file.ext"This is the FileMaker path format. This format can be used in both platforms and it is converted to native full path.
"file:\\\path\to\file.ext"URL used on unix. 24U SimpleFile Plug-In can read local files using URL. Use the same format as in your internet browser for local files.
"fsspec:-100:883688:file.ext"The old Macintosh FSSpec. This format is obsolete. It has been used in old Mac OS prior to Mac OS X. If you try to use this on Windows SimpleFile will take the only the last part and tries to use it as relative or absolute path.

Relative paths current directories

Relative path starts at just opened and active local solution. If the current opened solution is not local but on FM Server, relative path starts inside FileMaker (Pro or Server) installation directory. If your solution will run on FM Server or inside Web Publishing it is recommended to use only full paths.

Paths to directories

Paths to directories have the same form as paths to files. Paths to directories are not ended by slash or backslash except paths in FileMaker format which end with slash.

File Permissions in SimpleFile

24U SimpleFile Plug-In is a part of FileMaker Pro (client side) or FileMaker Server (server side) or Web Publishing Engine (server side) process. All credentials granted to these processes are also valid for the plug-in.

In FileMaker Server on Mac OS X the folder /Library/FileMaker Server/Data is accessible by the plug-in. You can specify more files and folder by adding them to fmsadmin group.

In FileMaker Server on Windows the direcotry C:\Program Files\FileMaker\FileMaker Server\Data is accessible by the plug-in. You can specify more files and folder by adding them to fmsadmin group.

Valid Encodings

This is the list of valid encodings.

whatDescription
"default",
"text"
The system default encoding for text files. On english system it is "x-mac-roman" on Mac and "windows-1252" on Windows.
"hex-dump"Useful for reading binary files. The content is returned in hex numbers delimited by space.
"base64"Useful for reading binary files. The content is returned in ASCII characters.
"utf-16"Text files encoded in 16-bit encoding.
"utf-8"Utf-8 unicode encoding. The number of bytes is not equal to number of characters.
"x-mac-roman",
"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"
Macintosh 8-bit encodings. The first is the most used.
"dos",
"windows-1252",
"windows-1250",
"windows-1251",
"windows-1253",
"windows-1254",
"windows-1255",
"windows-1256",
"windows-1257"
Windows 8-bit encodings. Windows-1252 is used in the English version of Windows..
"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"
The encodings defined by the ISO standard.
"euc-jp",
"euc-kr",
"gb2312",
"johab"
The other text encodings.
"image"The image type. The result of the function will be the FileMaker container filled with image.
"jpeg"The jpeg image type. The result of the function will be the FileMaker container filled with jpeg image.
"gif"The gif image type. The result of the function will be the FileMaker container filled with gif image.
"png"The png image type. The result of the function will be the FileMaker container filled with png image.
"bmp"The bmp image type. The result of the function will be the FileMaker container filled with bmp image.
"x-pict"The Macintosh picture type. The result of the function will be the FileMaker container filled with Macintosh picture. FileMaker is able to show Macintosh picture in the container only on Mac.
"file"The general file type. The result of the function will be the FileMaker container with the file icon.
"rtf"The rich text format. Use this format to write styled FileMaker text into rtf file.

Recognized FileMaker Container Types

This is the list of recognized FileMaker Container types.

TypeDescription
"FILE"Generic file with unknown type
"JPEG"JPEG Picture
"PNGf"PNG Picture
"GIFf"GIF Picture
"BMPf"BMP Picture
"PICT"PICT Picture
"TIFF"TIFF Picture

Other container types may be returned if they are natively supported by your version of FileMaker Pro and your operating system, but correct recognition of them by this function is not guaranteed.

Error Codes Table

Here is the list of all error codes which can be returned from the plug-in. The error codes are derived from MacErrors.h header file from Mac OS. Plug-In's custom error codes are positive numbers in range between 2400 and 9999. If function fails it either returns "?" signaling error or it directly returns the error code. If it returns "?" you can use SFile_Get( "lastError" ) to obtain the code.

CodeDescription
-4Not implementedIf you see this error please report the error and steps to reproduce it to 24U Support. This error should never be invoked in the release version of the plug-in.
-33Directory fullNo new file or directory can be added to the directory because file system limits number of nodes. This is a very rare error in modern file systems (HFS+ or NTFS). It can be seen on old flash drives with FAT16 filesystem.
-34Disk fullNo new file or directory can be added to the disk because it is full. Make some space on the disk and try again.
-35No such volumeYou are trying to access volume which doesn't exist.
-36IO foundSomething bad and undefined happened during IO operation. Try it again and if it doesn't help check your file system.
-43File not foundThe function needs existing file or folder but it is not able to find it.
-45File is lockedThe function needs to access the file which is locked.
-47File is busyThe function cannot delete the file which is opened. Check other applications opened files.
-48Duplicate filenameYou are trying to rename the file to the name of some existing file. Choose another name or rename the existing file.
-50Parameter errorOne or more parameters of the function are not in correct format. Function needs more / less parameters. Syntax of the function is wrong.
-52File position errorRead / Write function cannot access this position in the file.
-53Volume on line errorThe volume has been ejected and plug-in cannot access it.
-54Permission errorThe plug-in has permission problem accessing the file.
-1303Different volumeCannot move files or folders between different volumes. Use copy command instead.
2400Unknown errorAn unknown error occurred. If you see this error please report the error and steps to reproduce it to 24U Support. We will try to identify error conditions and add the new error code to this list.