BinaryFile.Length
-----------------

Queries length of current file.

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

MBS( "BinaryFile.Length"; BinaryFileRef ) 

**MBS**( **"BinaryFile.Length";** /\* Queries length of current file. \*/  
**$BinaryFileRef**) /\* The reference number for the open file.e.g. $FH \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BinaryFileRef | The reference number for the open file. | $FH |

### Result

Returns number or error.

### Description

Queries length of current file.  
### Examples

Query length:

 Set Variable \[ $fh ; Value: MBS ( "[BinaryFile.Open](BinaryFileOpen.md)"; "/Users/cs/Desktop/test.txt" ) \]   
Set Variable \[ $len ; Value: MBS ( "BinaryFile.Length"; $fh ) \]   
Set Variable \[ $r ; Value: MBS ( "[BinaryFile.Close](BinaryFileClose.md)"; $fh ) \]  
### See also

- [BinaryFile.Close](BinaryFileClose.md)
- [BinaryFile.Create](BinaryFileCreate.md)
- [BinaryFile.List](BinaryFileList.md)
- [BinaryFile.Open](BinaryFileOpen.md)
- [BinaryFile.Position](BinaryFilePosition.md)
- [BinaryFile.ReadContainer](BinaryFileReadContainer.md)
- [BinaryFile.ReadPDF](BinaryFileReadPDF.md)
- [BinaryFile.ReadText](BinaryFileReadText.md)
- [BinaryFile.Seek](BinaryFileSeek.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)
- [Tip of the day: Split large files into smaller chunks](https://www.mbsplugins.de/archive/2018-08-19/Tip_of_the_day_Split_large_fil/monkeybreadsoftware_blog_filemaker)

This function is free to use.

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

  
[BinaryFile.EOF](BinaryFileEOF.md) - [BinaryFile.List](BinaryFileList.md)

[HTML Version](BinaryFileLength.shtml)