# cFile

Provides access to file systems, allowing files to be processed by any other components or messages from other components to be saved to the disk.

For more information, see the Apache camel documentation https://camel.apache.org/components/latest/.

## cFile Standard properties

These properties are used to configure cFile running in the Standard Job framework.

The Standard cFile component belongs to the Connectivity family.

Information noteNote: The properties of cFile is updated in R2026-01. To have all the properties in the following tables, you need to install the R2026-01 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

## Basic settings

| Properties | Description |
| --- | --- |
| Path | Path to the file or files to be accessed or saved. |
| The following options are available when the cFile is used as a consumer: |  |
| Parameters/noop | When enabled, the file will not be moved or deleted in any way. |
| Parameters/recursive | When enabled, files in all the sub-directories will be consumed as<br>well. |
| Parameters/readlock | When enabled, the file will be consumed only if it has exclusive read-lock on<br>it. Select the strategy from:<br><br><ul> <li><span>none</span>: No read lock is in use.</li> <li><span>markerFile</span>: A marker file will be created and a                           lock is hold on the file. </li> <li><span>fileLock</span>: For using java.nio.channels.FileLock.                           This approach should be avoided when accessing a remote file system via a                           mount/share unless that file system supports distributed file locks. </li> <li><span>rename</span>: Try to rename the file as a test to see                           if an exclusive read lock can be obtained.</li> <li><span>idempotent</span>: For using an idempotentRepository as                           the read-lock. This allows to use read-locks if the idempotent repository                           implementation supports clustering.</li> <li><span>idempotent-changed</span>: For using an                           idempotentRepository and changed as the combined read-lock. This allows                           to use read-locks if the idempotent repository implementation supports                           clustering. </li> <li><span> idempotent-rename</span>: For using an                           idempotentRepository and rename as the combined read-lock. This allows to                           use read-locks if the idempotent repository implementation supports                           clustering.</li> </ul> |
| Parameters/doneFileName | The name of a marker file (done file) to signal when a file is done and ready<br>to be consumed. If provided, the file will only be consumed if a done file<br>exists. The done file is always expected in the same folder as the original<br>file. |
| Filter | Select a filter for the files to be consumed from:<br><br><ul> <li><span>fileName</span>: Filters the files based on the file name.                        Specify the name of the file in the <span>fileName</span>                        field.</li> <li><span>Ant</span>: Filters the files based on the Ant style.                        Specify the inclusion and exclusion criteria respectively. Select the                           <span>case sensitive</span> checkbox to enable case sensitive                        matching. Multiple inclusions and exclusions can be separated by comma. If                        both inclusion and exclusion are used, exclusion takes precedence over                        inclusion. </li> <li><span>Regex</span>: Filters the files based on the regex pattern.                        Specify the inclusion and exclusion criteria respectively. The matching is                        case insensitive.</li> <li><span>Extension</span>: Filters the files based on the file                        extension. Specify the inclusion and exclusion criteria respectively. The                        matching is case insensitive. Multiple extensions can be separated by                        comma.</li> </ul> |
| move/success | This option allows you to move files that are consumed successfully to another<br>location. Enter the success folder of your choice. For example, to move files<br>into a .done sub-directory, enter ".done". |
| move/failed | This option allows you to move files that can not be consumed successfully to<br>another location. Enter the error folder of your choice. |
| move/delete file | Select this checkbox to delete the file after it is consumed successfully. |

The following options are available when the cFile is used as a producer:

| Properties | Description |
| --- | --- |
| FileName | The name of the file to write. |
| Parameters/fileExist | Select the operation if a file with the name specified in the<br>FileName field already exists from:<br><br><ul> <li><span>Override</span>: Replace the existing file.</li> <li><span>Append</span>: Add content to the existing file.</li> <li><span>Fail</span>: Throw a GenericFileOperationException,                           indicating that there is already an existing file.</li> <li><span>Ignore</span>: Silently ignore the problem and do not                           override the existing file.</li> <li><span>Move</span>: Move any existing files to a target folder                           before writing the file. Specify the target folder of your choice in the                              <span>move/exisiting</span> field. </li> <li><span>TryRename</span>: Try renaming the file without doing                           any exists check.</li> </ul> |
| Parameters/doneFileName | The name of a marker file (done file) to signal when the original file has been<br>written. If provided, a done file will be written. The done file will be empty<br>and always written in the same folder as the original file. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Parameters/AutoCreate | Select this checkbox to create the directory specified in the Path field automatically if it does not<br>exist. |
| Parameters/Encoding | Specify the encoding of the file, ISO-8859-15, UTF-8, or<br>CUSTOM. |
| Advanced | Set the optional arguments in the corresponding table. Click [+] as many times as required to add arguments to the<br>table. In the Name field, you can either select the URI<br>option from the drop-down list, or enter an option name that is not available in<br>the list. Then click the corresponding Value<br>field and enter a value. See the site http://camel.apache.org/file2.html for available URI options. |

The following options are available only when the cFile is used as a producer:

| Properties | Description |
| --- | --- |
| Parameters/Flatten | Select this checkbox to flatten the file name path to strip any<br>leading paths. This allows you to produce recursively into sub-directories, but<br>when you, for example, write the files to another directory, they will be<br>written in a single directory. |
| Parameters/BufferSize(kb) | Write buffer sized in bytes. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | cFile can be a start, middle or<br>end component in a Route. |
| Limitation | n/a |

**Related concepts**

* [Reading and writing files in the local file system](https://help.qlik.com/talend/en-US/mediation-components/8.0/mediation-file/cfile-reading-and-writing-files-in-the-local-file-system)