]>
git.proxmox.com Git - proxmox-backup.git/blob - src/pxar/helper.rs
2 use nix
::sys
::stat
::FileStat
;
5 pub fn is_directory(stat
: &FileStat
) -> bool
{
6 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFDIR
10 pub fn is_symlink(stat
: &FileStat
) -> bool
{
11 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFLNK
15 pub fn is_reg_file(stat
: &FileStat
) -> bool
{
16 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFREG
20 pub fn is_block_dev(stat
: &FileStat
) -> bool
{
21 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFBLK
25 pub fn is_char_dev(stat
: &FileStat
) -> bool
{
26 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFCHR
30 pub fn is_fifo(stat
: &FileStat
) -> bool
{
31 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFIFO
34 pub fn is_socket(stat
: &FileStat
) -> bool
{
35 (stat
.st_mode
& libc
::S_IFMT
) == libc
::S_IFSOCK