##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::filesystem::path::remove_filename

From cppreference.com
< cpp‎ | experimental‎ | fs‎ | path

path& remove_filename() | (1) | (filesystem TS)

Removes a single filename component.

| This section is incomplete

### [edit] Parameters

(none)

### [edit] Return value

*this

### [edit] Exceptions

(none)

### [edit] Example

Run this code

    #include <filesystem>
    #include <iostream>

    int main()
    {
        std::cout << std::fs::path("/foo").remove_filename() << '\n';
        std::cout << std::fs::path("/").remove_filename() << '\n';
    }

Output:

    /

### [edit] See also

| This section is incomplete

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/fs/path/remove_filename&oldid=68625"
Category:

- Todo without reason