{"action":"created","issue":{"url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/38","repository_url":"https://api.github.com/repos/andreafrancia/trash-cli","labels_url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/38/comments","events_url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/38/events","html_url":"https://github.com/andreafrancia/trash-cli/issues/38","id":35226117,"number":38,"title":"Cannot trash files on the *same* partition as the trash","user":{"login":"protist","id":646668,"avatar_url":"https://avatars.githubusercontent.com/u/646668?v=3","gravatar_id":"","url":"https://api.github.com/users/protist","html_url":"https://github.com/protist","followers_url":"https://api.github.com/users/protist/followers","following_url":"https://api.github.com/users/protist/following{/other_user}","gists_url":"https://api.github.com/users/protist/gists{/gist_id}","starred_url":"https://api.github.com/users/protist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/protist/subscriptions","organizations_url":"https://api.github.com/users/protist/orgs","repos_url":"https://api.github.com/users/protist/repos","events_url":"https://api.github.com/users/protist/events{/privacy}","received_events_url":"https://api.github.com/users/protist/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"andreafrancia","id":260852,"avatar_url":"https://avatars.githubusercontent.com/u/260852?v=3","gravatar_id":"","url":"https://api.github.com/users/andreafrancia","html_url":"https://github.com/andreafrancia","followers_url":"https://api.github.com/users/andreafrancia/followers","following_url":"https://api.github.com/users/andreafrancia/following{/other_user}","gists_url":"https://api.github.com/users/andreafrancia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreafrancia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreafrancia/subscriptions","organizations_url":"https://api.github.com/users/andreafrancia/orgs","repos_url":"https://api.github.com/users/andreafrancia/repos","events_url":"https://api.github.com/users/andreafrancia/events{/privacy}","received_events_url":"https://api.github.com/users/andreafrancia/received_events","type":"User","site_admin":false},"assignees":[{"login":"andreafrancia","id":260852,"avatar_url":"https://avatars.githubusercontent.com/u/260852?v=3","gravatar_id":"","url":"https://api.github.com/users/andreafrancia","html_url":"https://github.com/andreafrancia","followers_url":"https://api.github.com/users/andreafrancia/followers","following_url":"https://api.github.com/users/andreafrancia/following{/other_user}","gists_url":"https://api.github.com/users/andreafrancia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreafrancia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreafrancia/subscriptions","organizations_url":"https://api.github.com/users/andreafrancia/orgs","repos_url":"https://api.github.com/users/andreafrancia/repos","events_url":"https://api.github.com/users/andreafrancia/events{/privacy}","received_events_url":"https://api.github.com/users/andreafrancia/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2014-06-08T02:50:39Z","updated_at":"2017-01-04T19:15:36Z","closed_at":"2017-01-04T19:14:43Z","body":"I'm going to open a new issue so it doesn't get lost. This was originally posted in issue https://github.com/andreafrancia/trash-cli/issues/13#issuecomment-45187738\r\n\r\nI understand that trash-cli cannot trash files when the trash and the file are on seperate partitions. However, I'm now running into the opposite of this. I have my trash on HDD, and my home on SDD. This time, I can only trash files that are on the SDD, and not those on the HDD (the same partition as the trash). As you can see below, I can trash okay if I specify a semi-absolute path, or a relative path in some cases. However, it fails if I specify the totally absolute path (without symlinks, see below). Also see the end for a workaround script.\r\n\r\n```\r\n$ mount\r\nproc on /proc type proc (rw,nosuid,nodev,noexec,relatime)\r\nsys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)\r\ndev on /dev type devtmpfs (rw,nosuid,relatime,size=8162056k,nr_inodes=2040514,mode=755)\r\nrun on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)\r\n/dev/sdb7 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)\r\nsecurityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)\r\ntmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)\r\ndevpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)\r\ntmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)\r\ncgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)\r\npstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)\r\ncgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)\r\ncgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)\r\ncgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)\r\ncgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)\r\ncgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)\r\ncgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)\r\ncgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)\r\nsystemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)\r\nmqueue on /dev/mqueue type mqueue (rw,relatime)\r\nconfigfs on /sys/kernel/config type configfs (rw,relatime)\r\ndebugfs on /sys/kernel/debug type debugfs (rw,relatime)\r\nhugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)\r\ntmpfs on /tmp type tmpfs (rw)\r\n/dev/sdb8 on /home type ext4 (rw,relatime,data=ordered)\r\n/dev/sda2 on /HDD type ext4 (rw,relatime,data=ordered)\r\n/dev/sda2 on /var/cache type ext4 (rw,relatime,data=ordered)\r\n/dev/sda2 on /var/log type ext4 (rw,relatime,data=ordered)\r\n/dev/sda2 on /var/tmp type ext4 (rw,relatime,data=ordered)\r\ntmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1632972k,mode=700,uid=1000,gid=1000)\r\nfusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)\r\ngvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)\r\nbinfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)\r\n$ ls -lad /\r\ndrwxr-xr-x 18 root root 4096 Jun  5 01:22 /\r\n$ ls -lad /home\r\ndrwxr-xr-x 5 root root 4096 May 21 15:31 /home\r\n$ ls -lad /home/protist\r\ndrwxr-x--- 115 protist protist 4096 Jun  5 16:52 /home/protist\r\n$ ls -lad /home/protist/HDD\r\ndrwxr-x--- 10 protist protist 4096 Jun  5 16:53 /home/protist/HDD  -> /HDD/protist\r\n$ ls -lad /home/protist/.local/share/Trash\r\nlrwxrwxrwx 1 protist protist 49 Jun  5 17:04 /home/protist/.local/share/Trash -> /HDD/protist/.SDDsymlinks/home/protist/.local/share/Trash\r\n\r\n$ cd ~\r\n$ touch foo\r\n$ trash foo # works for files on a different partition.\r\n$ cd ~/HDD\r\n$ touch foo\r\n$ trash foo # fails for files on the same partition.\r\ntrash: cannot trash regular empty file `foo'\r\n$ trash ./foo # fails for this format\r\ntrash: cannot trash regular empty file `./foo'\r\n$ trash ~/HDD/foo # works if I specify relative to home directory, with \"semi-absolute\" path.\r\n$ touch foo\r\n$ cd ..\r\n$ trash HDD/foo # works again for this relative path.\r\n$ cd ~/HDD\r\n$ touch foo\r\n$ readlink -e foo\r\n/HDD/protist/foo\r\n$ trash /HDD/protist/foo # fails again for totally absolute path without symlinks.\r\ntrash: cannot trash regular empty file `/HDD/protist/foo'\r\n```\r\n\r\nI've worked around this by defining a trash wrapper in my `$PATH`, ahead of `/usr/bin/trash`. This works well, and now allows trashing of all files, no matter what partition they are on! I've put this in `/usr/local/bin/trash`\r\n\r\n```\r\n#!/usr/bin/env bash\r\n# Workaround for trash-cli not being able to trash files on the *same* partition.\r\n\r\nfor i in \"$@\"; do\r\n  fullpath=\"$(readlink -e \"$i\")\"\r\n  fixedpath=\"$(echo \"$fullpath\" | sed \"s,/HDD/$USER,$HOME/HDD,\")\"\r\n  /usr/bin/trash \"$fixedpath\"\r\ndone\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/comments/270459746","html_url":"https://github.com/andreafrancia/trash-cli/issues/38#issuecomment-270459746","issue_url":"https://api.github.com/repos/andreafrancia/trash-cli/issues/38","id":270459746,"user":{"login":"andreafrancia","id":260852,"avatar_url":"https://avatars.githubusercontent.com/u/260852?v=3","gravatar_id":"","url":"https://api.github.com/users/andreafrancia","html_url":"https://github.com/andreafrancia","followers_url":"https://api.github.com/users/andreafrancia/followers","following_url":"https://api.github.com/users/andreafrancia/following{/other_user}","gists_url":"https://api.github.com/users/andreafrancia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreafrancia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreafrancia/subscriptions","organizations_url":"https://api.github.com/users/andreafrancia/orgs","repos_url":"https://api.github.com/users/andreafrancia/repos","events_url":"https://api.github.com/users/andreafrancia/events{/privacy}","received_events_url":"https://api.github.com/users/andreafrancia/received_events","type":"User","site_admin":false},"created_at":"2017-01-04T19:15:36Z","updated_at":"2017-01-04T19:15:36Z","body":"Thank you for your feedback, please try this new version, it should be fixed.\r\nLet me know.\r\n"}}
{"actor":{"display_login":"andreafrancia"}}