F.2 FlattenMapper
Prev | Appendix F. Core mappers | Next

## F.2 FlattenMapper

The `FlattenMapper` removes the directories from a filename and solely returns the filename.

    <copy todir="/tmp">
      <mapper type="flatten" />

      <fileset refid="someid" />
    </copy>

This code will copy all files in the fileset to /tmp. All files will be in the target directory.

### F.2.1 Examples

    <mapper type="flatten" />

Applying the mapper, you will get the following results from the following filenames:

Table F.2: Result of mapping

From | To
--- | ---
`test.txt` | `test.txt`
`./foo/bar/test.bak` | `test.bak`

Prev | Up | Next
Appendix F. Core mappers | Home | F.3 GlobMapper