Open pjknkda opened 1 year ago
In overlayfs, directories always have st_dev from lower filesystem whereas files can have st_dev either from lower filesystem or upper filesystem. Due to this behavior, https://github.com/arsenetar/send2trash/blob/1.8.1b0/send2trash/plat_other.py#L178 always fails when the file's st_dev is from the upper filesystem. gio already tackled this issue, by avoiding comparison b/w file_dev and trash_dev, instead, it compares parent_dir(file).dev to trash_dev (ref: https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/glocalfile.c#L2019). I think send2trash also can adapt the same approach.
st_dev
file_dev
trash_dev
parent_dir(file).dev
Thanks for the information on the gio approach likely that can be leveraged here as well, will look into that. The st_dev has been somewhat problematic in I believe more than one case.
In overlayfs, directories always have
st_dev
from lower filesystem whereas files can havest_dev
either from lower filesystem or upper filesystem. Due to this behavior, https://github.com/arsenetar/send2trash/blob/1.8.1b0/send2trash/plat_other.py#L178 always fails when the file'sst_dev
is from the upper filesystem. gio already tackled this issue, by avoiding comparison b/wfile_dev
andtrash_dev
, instead, it comparesparent_dir(file).dev
totrash_dev
(ref: https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/glocalfile.c#L2019). I think send2trash also can adapt the same approach.