# SalFileHandle

Namespace: **PPJ.Runtime**

Assembly: **PPJ.Runtime.49** (4.9.0.0)

{% tabs %}
{% tab title="C#" %}

```csharp
public struct SalFileHandle : ValueType, ISerializable, IXmlSerializable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Structure SalFileHandle
    Implements ValueType, ISerializable, IXmlSerializable
```

{% endtab %}
{% endtabs %}

## Properties

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)FileStream

[FileStream](https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream): Returns the wrapped FileStream object.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Handle

[IntPtr](https://docs.microsoft.com/en-us/dotnet/api/system.intptr): Returns the handle for this SalFileHandle object

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)IsBinary

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns true if the file was opened in binary mode.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)IsNull

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Checks if this SalFileHandle object contains a null value.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)LastError

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Returns the last error code.

## Methods

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Close()

Closes a file.

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)Copy(sSourcePath, sDestPath, bOverWrite)

Copies the contents of one file (source) to another file (destination).

| Parameter       | Type                                                                                             | Description                                                                                                                                                                                                                                                                                                                       |
| --------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sSourcePath** | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)  | The full path name of the source file.                                                                                                                                                                                                                                                                                            |
| **sDestPath**   | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)  | The full path name of the destination file.                                                                                                                                                                                                                                                                                       |
| **bOverWrite**  | [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | Specifies whether (TRUE) or not (FALSE) to overwrite the destination file. If the destination file already exists and bOverWrite is FALSE, then SalFileCopy fails, and returns FILE\_CopyExist. If the destination file already exists and bOverWrite is TRUE, then SalFileCopy succeeds and the destination file is overwritten. |

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). nStatus

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)CreateDirectory(sDir)

Creates a directory.

| Parameter | Type                                                                                            | Description                              |
| --------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------- |
| **sDir**  | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The full path name of the new directory. |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)FromHandle(handle)

Returns the SalFileHandle object from the handle

| Parameter  | Type                                                                | Description |
| ---------- | ------------------------------------------------------------------- | ----------- |
| **handle** | [IntPtr](https://docs.microsoft.com/en-us/dotnet/api/system.intptr) |             |

**Returns:** [SalFileHandle](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetChar()

Returns the next character in an open file.

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). nChar

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetChar(nChar)

| Parameter | Type                                                                                             | Description |
| --------- | ------------------------------------------------------------------------------------------------ | ----------- |
| **nChar** | [SalNumber&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)GetCurrentDirectory(sPath)

| Parameter | Type                                                                                             | Description |
| --------- | ------------------------------------------------------------------------------------------------ | ----------- |
| **sPath** | [SalString&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)GetDateTime(sFilename, dtDateTime)

| Parameter      | Type                                                                                               | Description |
| -------------- | -------------------------------------------------------------------------------------------------- | ----------- |
| **sFilename**  | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)    |             |
| **dtDateTime** | [SalDateTime&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)GetDrive()

Gets the letter of the default (current) disk drive.

**Returns:** [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). sDriveLetter

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetObjectData(info, context)

| Parameter   | Type                                                                                                            | Description |
| ----------- | --------------------------------------------------------------------------------------------------------------- | ----------- |
| **info**    | [SerializationInfo](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.serializationinfo) |             |
| **context** | [StreamingContext](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.streamingcontext)   |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetString(maxLength)

Returns the next line from an open file. Lines are terminated by \r\n or \r or&#x20;

| Parameter     | Type                                                              | Description |
| ------------- | ----------------------------------------------------------------- | ----------- |
| **maxLength** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) |             |

**Returns:** [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetString(line, maxLength)

| Parameter     | Type                                                                                             | Description |
| ------------- | ------------------------------------------------------------------------------------------------ | ----------- |
| **line**      | [SalString&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |
| **maxLength** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                |             |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Open(fileName, flags)

Opens, re-opens, creates, or deletes a file.

| Parameter    | Type                                                                | Description                                                                                                                                  |
| ------------ | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) | The name of the file to open, create, delete, or test.                                                                                       |
| **flags**    | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)   | A constant that specifies the style in which to open the file. nStyle can be one or more styles combined using the bitwise OR (\|) operator. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Open(fileName, flags, encoding)

Opens, re-opens, creates, or deletes a file.

| Parameter    | Type                                                                         | Description                                                                                                                                  |
| ------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)          | The name of the file to open, create, delete, or test.                                                                                       |
| **flags**    | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)            | A constant that specifies the style in which to open the file. nStyle can be one or more styles combined using the bitwise OR (\|) operator. |
| **encoding** | [Encoding](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding) | Encoder used to read/write characters.                                                                                                       |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)PutChar(c)

Writes a character to an open file.

| Parameter | Type                                                              | Description                                                |
| --------- | ----------------------------------------------------------------- | ---------------------------------------------------------- |
| **c**     | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) | The ANSI numeric value of the character to write to hFile. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)PutString(text)

Writes a string to an open file.

| Parameter | Type                                                                | Description          |
| --------- | ------------------------------------------------------------------- | -------------------- |
| **text**  | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) | The string to write. |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Read(maxLength)

Reads a buffer of characters from an open file to a string .

| Parameter     | Type                                                              | Description |
| ------------- | ----------------------------------------------------------------- | ----------- |
| **maxLength** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) |             |

**Returns:** [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Read(buffer, maxLength)

| Parameter     | Type                                                                                             | Description |
| ------------- | ------------------------------------------------------------------------------------------------ | ----------- |
| **buffer**    | [SalString&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |
| **maxLength** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                |             |

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Read(buffer, maxLength)

| Parameter     | Type                                                                                             | Description |
| ------------- | ------------------------------------------------------------------------------------------------ | ----------- |
| **buffer**    | [SalBinary&](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) |             |
| **maxLength** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                                |             |

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)RemoveDirectory(sDir)

Deletes a directory.

| Parameter | Type                                                                                            | Description                                    |
| --------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| **sDir**  | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The full path name of the directory to delete. |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Seek(bytes, position)

Positions the file pointer in an open file. The next file operation (such as a read or write) takes place at this new location.

| Parameter    | Type                                                              | Description                                                                                                                  |
| ------------ | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **bytes**    | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) | The specific position of the file pointer; the number of bytes from nPosition where the next file operation will take place. |
| **position** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32) | The general position of the file pointer; one of the following values: FILE\_SeekBegin FILE\_SeekCurrent FILE\_SeekEnd       |

**Returns:** [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)SetCurrentDirectory(sPath)

Changes the current working directory. If the specified path does not contain a drive letter, the default drive's current directory is changed. Otherwise, the specified drive's current directory is changed and the specified drive is made the current drive.

| Parameter | Type                                                                                            | Description                                         |
| --------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **sPath** | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The path name of the new current working directory. |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)SetDateTime(sFilename, dtDateTime)

Sets the modification date and time of the specified file.

| Parameter      | Type                                                                                              | Description                                                   |
| -------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **sFilename**  | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)   | The name of the file whose modification date you want to set. |
| **dtDateTime** | [SalDateTime](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The modification date and time.                               |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media)SetDrive(sDriveLetter)

Sets the current disk drive to the specified drive letter.

| Parameter        | Type                                                                                            | Description                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **sDriveLetter** | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The new disk drive letter. The length of this parameter's value is one character. |

**Returns:** [SalBoolean](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). bOk

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Tell()

Returns the current position in an open file.

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle). nPos

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Write(str, length)

Writes a string to an open file.

| Parameter  | Type                                                                                            | Description                   |
| ---------- | ----------------------------------------------------------------------------------------------- | ----------------------------- |
| **str**    | [SalString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The string to write to hFile. |
| **length** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                               | The number of bytes to write. |

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Write(binary, length)

Writes a binary buffer to an open file.

| Parameter  | Type                                                                                            | Description                   |
| ---------- | ----------------------------------------------------------------------------------------------- | ----------------------------- |
| **binary** | [SalBinary](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | The string to write to hFile. |
| **length** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)                               | The number of bytes to write. |

**Returns:** [SalNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle).

## Used By

| Name                                                                                                           | Description                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [Sal.WindowHandleToNumber](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | Converts a [SalFileHandle](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) to a number.     |
| [Sal.FilePutChar](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)          | Writes a character to an open file.                                                                                             |
| [Sal.FilePutStr](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)           | Writes a string to an open file and appends a carriage return/line feed character to the string.                                |
| [Sal.FileRead](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             |                                                                                                                                 |
| [Sal.FileSeek](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             | Positions the file pointer in an open file. The next file operation (such as a read or write) takes place at this new location. |
| [Sal.FileTell](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             | Returns the current position in an open file.                                                                                   |
| [Sal.FileWrite](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)            | Writes a string to an open file.                                                                                                |
| [Sal.FileGetChar](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)          |                                                                                                                                 |
| [Sal.FileGetStr](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)           |                                                                                                                                 |
| [SalFileHandle.FromHandle](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle) | Returns the SalFileHandle object from the handle                                                                                |
| [Vis.FileClose](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)            |                                                                                                                                 |
| [Vis.FileRead](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             |                                                                                                                                 |
| [Vis.FileReadString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)       |                                                                                                                                 |
| [Vis.FileReadBinary](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)       |                                                                                                                                 |
| [Vis.FileSeek](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             |                                                                                                                                 |
| [Vis.FileTell](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)             |                                                                                                                                 |
| [Vis.FileWrite](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)            |                                                                                                                                 |
| [Vis.FileWriteString](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)      |                                                                                                                                 |
| [Vis.FileWriteBinary](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)      |                                                                                                                                 |
| [XSal.GZipPutChar](https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle)         |                                                                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://desktop-api.iceteagroup.com/ppj.runtime.49/types/ppj.runtime.salfilehandle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
