Skip to content

scan_and_remove_entry_recursively hangs if directory contains a named pipe (FIFO) #82

@angxiang

Description

@angxiang

Hello,

we are using your crate to perform directory cleanup on a Linux machine. When using the remove_dir_all / remove_dir_contents call, we have noticed that if the directory or subdirectories contain a named pipe, the function will hang and the cleanup will not finish. The issue comes from using open_dir_at in scan_and_remove_entry_recursively to determine whether you are currently handling a directory or not. Since open_dir_at will always pass the O_RDONLY flag, when this is called on a named pipe, the call blocks (until another process opens the pipe for writing, which does not happen).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions