---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [cartridges](../index.md) / CartridgeFileSystemHost

# Interface: CartridgeFileSystemHost

Defined in: [packages/b2c-tooling-sdk/src/cartridges/host.ts:15](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cartridges/host.ts#L15)

Synchronous filesystem access used by the cartridge resolver and discovery.

Hosts are injectable so the same logic can run inside environments that own
their own filesystem view, such as the TypeScript language service (`ts.sys`),
or against an in-memory tree in tests.

## Properties

### useCaseSensitiveFileNames

> **useCaseSensitiveFileNames**: `boolean`

Defined in: [packages/b2c-tooling-sdk/src/cartridges/host.ts:26](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cartridges/host.ts#L26)

Whether path comparisons are case-sensitive. When false, cartridge ownership
checks fold case; filesystem probes always use the original case.

## Methods

### fileExists()

> **fileExists**(`filePath`): `boolean`

Defined in: [packages/b2c-tooling-sdk/src/cartridges/host.ts:17](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cartridges/host.ts#L17)

Returns true when `filePath` exists and is a file. Must not throw.

#### Parameters

##### filePath

`string`

#### Returns

`boolean`

***

### getDirectories()

> **getDirectories**(`dirPath`): readonly `string`[]

Defined in: [packages/b2c-tooling-sdk/src/cartridges/host.ts:21](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cartridges/host.ts#L21)

Returns the names (not paths) of the immediate subdirectories of `dirPath`. Must not throw.

#### Parameters

##### dirPath

`string`

#### Returns

readonly `string`[]

***

### readFile()

> **readFile**(`filePath`): `string` \| `undefined`

Defined in: [packages/b2c-tooling-sdk/src/cartridges/host.ts:19](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/cartridges/host.ts#L19)

Returns the file's UTF-8 contents, or undefined if it cannot be read. Must not throw.

#### Parameters

##### filePath

`string`

#### Returns

`string` \| `undefined`
