# SalFileHandle

Namespace: **PPJ.Runtime**

Assembly: **PPJ.Web.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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Handle

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)IsBinary

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)IsNull

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)LastError

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Stream

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

## Methods

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Close()

Closes a file.

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)Copy(sSourcePath, sDestPath, bOverWrite)

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

| Parameter       | Type                                                                                       | Description                                                                                                                                                                                                                                                                                                                       |
| --------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sSourcePath** | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md)   | The full path name of the source file.                                                                                                                                                                                                                                                                                            |
| **sDestPath**   | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md)   | The full path name of the destination file.                                                                                                                                                                                                                                                                                       |
| **bOverWrite**  | [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md) | 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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md). nStatus

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)CreateDirectory(sDir)

Creates a directory.

| Parameter | Type                                                                                     | Description                              |
| --------- | ---------------------------------------------------------------------------------------- | ---------------------------------------- |
| **sDir**  | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md) | The full path name of the new directory. |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md). bOk

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salfilehandle.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)GetChar()

Returns the next character in an open file.

**Returns:** [SalNumber](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md). nChar

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)GetChar(nChar)

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

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

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)GetCurrentDirectory(sPath)

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

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)GetDateTime(sFilename, dtDateTime)

| Parameter      | Type                                                                                       | Description |
| -------------- | ------------------------------------------------------------------------------------------ | ----------- |
| **sFilename**  | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md)   |             |
| **dtDateTime** | [SalDateTime&](https://web-api.iceteagroup.com/ppj.web.49/types/ppj.runtime.salfilehandle) |             |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)GetDrive()

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

**Returns:** [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md). sDriveLetter

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)GetString(line, maxLength)

| Parameter     | Type                                                                                     | Description |
| ------------- | ---------------------------------------------------------------------------------------- | ----------- |
| **line**      | [SalString&](https://web-api.iceteagroup.com/ppj.web.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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Read(buffer, maxLength)

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

**Returns:** [SalNumber](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Read(buffer, maxLength)

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

**Returns:** [SalNumber](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)RemoveDirectory(sDir)

Deletes a directory.

| Parameter | Type                                                                                     | Description                                    |
| --------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------- |
| **sDir**  | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md) | The full path name of the directory to delete. |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md). bOk

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md) | The path name of the new current working directory. |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md). bOk

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)SetDateTime(sFilename, dtDateTime)

Sets the modification date and time of the specified file.

| Parameter      | Type                                                                                         | Description                                                   |
| -------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **sFilename**  | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md)     | The name of the file whose modification date you want to set. |
| **dtDateTime** | [SalDateTime](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.saldatetime.md) | The modification date and time.                               |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md). bOk

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FuqnVoSwYo95wh3jzDFPE%2Fstatic.png?alt=media\&token=ac9ad63b-db19-46a9-a325-36647205a41a)SetDrive(sDriveLetter)

Sets the current disk drive to the specified drive letter.

| Parameter        | Type                                                                                     | Description                                                                       |
| ---------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| **sDriveLetter** | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md) | The new disk drive letter. The length of this parameter's value is one character. |

**Returns:** [SalBoolean](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salboolean.md). bOk

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Tell()

Returns the current position in an open file.

**Returns:** [SalNumber](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md). nPos

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Use(stream, flags)

Uses the specified *stream* .

| Parameter  | Type                                                                   | Description                                                                                                                                    |
| ---------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **stream** | [Stream](https://docs.microsoft.com/en-us/dotnet/api/system.io.stream) | The stream to read or write.                                                                                                                   |
| **flags**  | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)      | A constant that specifies the style in which to used the stream. 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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Use(stream, flags, encoding)

Uses the specified *stream* .

| Parameter    | Type                                                                         | Description                                                                                                                                    |
| ------------ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **stream**   | [Stream](https://docs.microsoft.com/en-us/dotnet/api/system.io.stream)       | The stream to read or write.                                                                                                                   |
| **flags**    | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)            | A constant that specifies the style in which to used the stream. 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://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Write(str, length)

Writes a string to an open file.

| Parameter  | Type                                                                                     | Description                   |
| ---------- | ---------------------------------------------------------------------------------------- | ----------------------------- |
| **str**    | [SalString](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salstring.md) | 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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md).

### ![](https://620403885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrwxBtXkZ9hhQWYdbGhAV%2Fuploads%2FCKg4odMPj9bBKavXG5j4%2Finstance.png?alt=media\&token=2ac4a01b-785e-4197-b802-d5aae2250f90)Write(binary, length)

Writes a binary buffer to an open file.

| Parameter  | Type                                                                                     | Description                   |
| ---------- | ---------------------------------------------------------------------------------------- | ----------------------------- |
| **binary** | [SalBinary](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salbinary.md) | 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://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salnumber.md).

## Used By

| Name                                                                                                                               | Description                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [Sal.WindowHandleToNumber](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#windowhandletonumber-window)    | Converts a SalFileHandle to a number.                                                            |
| [Sal.FileGetChar](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#filegetchar-file-charvalue)              |                                                                                                  |
| [Sal.FileGetStr](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#filegetstr-file-buffer-buffersize)        |                                                                                                  |
| [Sal.FilePutChar](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#fileputchar-file-charvalue)              | Writes a character to an open file.                                                              |
| [Sal.FilePutStr](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#fileputstr-file-str)                      | Writes a string to an open file and appends a carriage return/line feed character to the string. |
| [Sal.FileRead](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#fileread-file-buffer-bufferlength)          |                                                                                                  |
| [Sal.FileSeek](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#fileseek-file-bytes-position)               | Positions the file pointer in an open file.                                                      |
| [Sal.FileTell](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#filetell-file)                              | Returns the current position in an open file.                                                    |
| [Sal.FileWrite](https://docs.wisej.com/extensions/ppj.web.49/general/ppj.runtime.sal.md#filewrite-file-buffer-bufferlength)        | Writes a string to an open file.                                                                 |
| [SalFileHandle.FromHandle](https://docs.wisej.com/extensions/ppj.web.49/types/ppj.runtime.salfilehandle.md#fromhandle-handle)      | Returns the SalFileHandle object from the handle                                                 |
| [Vis.FileClose](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#fileclose-hfile)                   |                                                                                                  |
| [Vis.FileRead](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#fileread-hfile-sbuffer-nsize)       |                                                                                                  |
| [Vis.FileReadString](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#filereadstring-hfile-sline)   |                                                                                                  |
| [Vis.FileSeek](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#fileseek-hfile-noffset-norigin)     |                                                                                                  |
| [Vis.FileTell](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#filetell-hfile)                     |                                                                                                  |
| [Vis.FileWrite](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#filewrite-hfile-sbuffer-nsize)     |                                                                                                  |
| [Vis.FileWriteString](https://docs.wisej.com/extensions/ppj.web.vis.49/general/ppj.runtime.vis.vis.md#filewritestring-hfile-sline) |                                                                                                  |
| [XSal.GZipPutChar](https://docs.wisej.com/extensions/ppj.web.xsal.49/general/ppj.runtime.xsal.xsal.md#gzipputchar-param1-param2)   |                                                                                                  |
