The deletion of old recordings is not working if one runs rotter with a recording root directory on top of an XFS filesystem and has file deletion enabled (rotter -d <hours> ...):
[...]
[ERROR] Tue Feb 6 08:00:10 2018 Warning: not a file or a directory:
[ERROR] Tue Feb 6 08:00:10 2018 Warning: not a file or a directory:
[DEBUG] Tue Feb 6 08:00:10 2018 File deletion child-process has finished.
Apart from the actual file path which is missing in the error message (see #36), the file deletion doesn't work.
The problem relates from the fact that the value of dp->d_type from the readdir() call, will always be DT_UNKNOWN on XFS file systems (and probably others as well).
Quoting the READDIR(3) man page:
d_type This field contains a value indicating the file type [...]
[...]
DT_UNKNOWN The file type could not be determined.
Currently, only some filesystems (among them: Btrfs, ext2, ext3, and ext4) have
full support for returning the file type in d_type. All applications must
properly handle a return of DT_UNKNOWN.
A possible fix would be to call lstat() to get the file type, regardless of the filesystem in use.
The deletion of old recordings is not working if one runs rotter with a recording root directory on top of an XFS filesystem and has file deletion enabled (
rotter -d <hours> ...):Apart from the actual file path which is missing in the error message (see #36), the file deletion doesn't work.
The problem relates from the fact that the value of
dp->d_typefrom thereaddir()call, will always beDT_UNKNOWNon XFS file systems (and probably others as well).Quoting the READDIR(3) man page:
A possible fix would be to call
lstat()to get the file type, regardless of the filesystem in use.