BinaryFile.Append
-----------------

Opens a file to append data.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [BinaryFile](component_BinaryFile.md) | [7.3](newinversion73.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "BinaryFile.Append"; FilePath ) 

**MBS**( **"BinaryFile.Append";** /\* Opens a file to append data. \*/  
**$FilePath**) /\* The native file path. Something like "/Users/cs/desktop/test.txt" on Mac and "C:\\Programs\\Data\\test.txt" on Windows. Files without path end in the root directory on Mac.e.g. "test.txt" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| FilePath | The native file path. Something like "/Users/cs/desktop/test.txt" on Mac and "C:\\Programs\\Data\\test.txt" on Windows. Files without path end in the root directory on Mac. | "test.txt" |

### Result

Returns reference number or error.

### Description

Opens a file to append data.  
See also [Text.AppendTextFile](TextAppendTextFile.md).  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Append text to a file:

 Set Variable \[ $fh ; Value: MBS ( "BinaryFile.Append"; "/Users/cs/Desktop/test.txt" ) \]   
Set Variable \[ $r ; Value: MBS ( "[BinaryFile.WriteText](BinaryFileWriteText.md)"; $fh ; "Hello World") \]   
Set Variable \[ $r ; Value: MBS ( "[BinaryFile.Close](BinaryFileClose.md)"; $fh ) \]  
### See also

- [BinaryFile.Close](BinaryFileClose.md)
- [BinaryFile.Open](BinaryFileOpen.md)
- [BinaryFile.WriteText](BinaryFileWriteText.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [Text.AppendTextFile](TextAppendTextFile.md)

### Blog Entries

- [MBS Plugin Advent calendar: 3 - BinaryFile](https://www.mbsplugins.de/archive/2023-12-03/MBS_Plugin_Advent_calendar_3_-/monkeybreadsoftware_blog_filemaker)
- [FileMaker 18 File Script Steps vs. BinaryFile functions](https://www.mbsplugins.de/archive/2019-06-03/FileMaker_18_File_Script_Steps/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd June 2017 , last changed 12nd June 2017

  
[Barcode.ZBarVersion](BarcodeZBarVersion.md) - [BinaryFile.Close](BinaryFileClose.md)

[HTML Version](BinaryFileAppend.shtml)