Right now, it's not possible to detect the presence of a device (or anything different than a regular file in POSIX terms). There is the typical item vfs.file.exists[file] but it discards many common file modes. At the moment the return value depends on what S_ISREG POSIX macro returns.
So it's not possible to check the presence of those types:
- S_ISDIR If the mode is from a directory.
- S_ISCHR If the mode is from a character special device file.
- S_ISBLK If the mode is from a block special device file.
- S_ISFIFO If the mode is from a FIFO (named pipe).
- S_ISLNK If the mode is from a symbolic link.
- S_ISSOCK If the mode is from a socket.
This proposal adds an optional parameter mode to the item vfs.file.exists in order to check for the presence of directories, devices, unix sockets, etc.
mode - POSIX mode (default is regular)
mode - possible values:
regular (default), directory, chardev, blockdev, fifo, symlink, socket