Possible bug? Permanently Remove filenames with a space.

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
igor83

Possible bug? Permanently Remove filenames with a space.

Post by igor83 »

On Linux Mint Maya Xfce, in Thunar, the Permanently Remove option will not remove filenames that have a space in them. It will go through the motions of deleting the file, including the user confirmation, but no file with a space (or possibly other atypical characters) in it will be removed.

By editing /usr/bin/mint-xfce-delete, I managed to fix this behavior by replacing this line:

Code: Select all

rm -rf "$file" | tee | sleep 3 |(zenity --title="$title	" --progress --pulsate --auto-kill --auto-close --text "<b>$title1		</b>" )
with these lines:

Code: Select all

until [ "$*" = "" ]
do
  rm -rf "$1"
  shift
done
#rm -rf "$file" | tee | sleep 3 |(zenity --title="$title	" --progress --pulsate --auto-kill --auto-close --text "<b>$title1		</b>" )
I am not sure why rm -rf "$file" won't work in instances where the filename has a space, because the syntax appears correct, as $file has been defined earlier as "$*", which should include all the user-selected files and folders passed from Thunar. Somehow the space in the filename jams the works.

I am new to Linux, so perhaps someone can explain this for me. If I am mistaken and there is something amiss with my system, I'd like to know that as well.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Possible bug? Permanently Remove filenames with a space.

Post by xenopeek »

I don't have Xfce installed right now; could you run the following command to find which package installs the /usr/bin/mint-xfce-delete file?

Code: Select all

dpkg -S mint-xfce-delete
Image
igor83

Re: Possible bug? Permanently Remove filenames with a space.

Post by igor83 »

xenopeek wrote:I don't have Xfce installed right now; could you run the following command to find which package installs the /usr/bin/mint-xfce-delete file?

Code: Select all

dpkg -S mint-xfce-delete
Thanks for the reply. The output of that command is:

Code: Select all

igor@igorland ~ $ dpkg -S mint-xfce-delete
mint-artwork-xfce: /usr/bin/mint-xfce-delete
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Possible bug? Permanently Remove filenames with a space.

Post by xenopeek »

Hmmm. This package doesn't have a repository on GitHub. You could post a bug for this on Launchpad: https://bugs.launchpad.net/linuxmint
Image
igor83

Re: Possible bug? Permanently Remove filenames with a space.

Post by igor83 »

xenopeek wrote:Hmmm. This package doesn't have a repository on GitHub. You could post a bug for this on Launchpad: https://bugs.launchpad.net/linuxmint
Done. This being my first time, I wasn't quite sure whether my analysis was up to snuff and wanted to pass it through the forum in case I had overlooked something simple. Now I'm fantasizing about getting my little patch included in the next version of Linux Mint Xfce. :P
yerc

Re: Possible bug? Permanently Remove filenames with a space.

Post by yerc »

igor83 wrote:
xenopeek wrote:Hmmm. This package doesn't have a repository on GitHub. You could post a bug for this on Launchpad: https://bugs.launchpad.net/linuxmint
Done. This being my first time, I wasn't quite sure whether my analysis was up to snuff and wanted to pass it through the forum in case I had overlooked something simple. Now I'm fantasizing about getting my little patch included in the next version of Linux Mint Xfce. :P
The 32-bit edition installed on my netbook does not have this issue.
Your signature line tells me you have LM 13 xfce 64-bit edition. Perhaps you might want to update your bug report with this information? :)
igor83

Re: Possible bug? Permanently Remove filenames with a space.

Post by igor83 »

yerc wrote:
igor83 wrote:
xenopeek wrote:Hmmm. This package doesn't have a repository on GitHub. You could post a bug for this on Launchpad: https://bugs.launchpad.net/linuxmint
Done. This being my first time, I wasn't quite sure whether my analysis was up to snuff and wanted to pass it through the forum in case I had overlooked something simple. Now I'm fantasizing about getting my little patch included in the next version of Linux Mint Xfce. :P
The 32-bit edition installed on my netbook does not have this issue.
Your signature line tells me you have LM 13 xfce 64-bit edition. Perhaps you might want to update your bug report with this information? :)
It is interesting that you say the 32-bit version does not have this issue, because I've noticed other problems with launching batch files from Thunar as well. I have noticed that batch files may have a maximum size of one line if launched from Thunar. Any more, and they won't work at all. That seemed like such a severe problem that I was suspicious I might be doing something wrong. Can you get a batch file to launch as a custom action from Thunar that executes more than one line?
yerc

Re: Possible bug? Permanently Remove filenames with a space.

Post by yerc »

igor83 wrote:It is interesting that you say the 32-bit version does not have this issue, because I've noticed other problems with launching batch files from Thunar as well. I have noticed that batch files may have a maximum size of one line if launched from Thunar. Any more, and they won't work at all. That seemed like such a severe problem that I was suspicious I might be doing something wrong. Can you get a batch file to launch as a custom action from Thunar that executes more than one line?
MD5 Checksum action item (with multiple lines) does what it's meant to here.
Does it work in your 64-bit install ?
igor83

Re: Possible bug? Permanently Remove filenames with a space.

Post by igor83 »

yerc wrote:
igor83 wrote:It is interesting that you say the 32-bit version does not have this issue, because I've noticed other problems with launching batch files from Thunar as well. I have noticed that batch files may have a maximum size of one line if launched from Thunar. Any more, and they won't work at all. That seemed like such a severe problem that I was suspicious I might be doing something wrong. Can you get a batch file to launch as a custom action from Thunar that executes more than one line?
MD5 Checksum action item (with multiple lines) does what it's meant to here.
Does it work in your 64-bit install ?
Note: to be clear, the above problem you are referring to, I have only verified in Xubuntu 12.10, not Linux Mint Maya Xfce.

Xubuntu has some funky ways of its own.

From Thunar, I've tested a custom action that calls a shell script with the following lines:

Code: Select all

 #!bin/sh
vlc "$1" & sleep 5 && xscreensaver-command -activate
This script is fully documented here. If I add lines above the second one, such as an if...then, checking for whether the selected file exists in order to avoid the dreaded VLC file-not-found endless loop (*if you have auto-rewind selected as a playlist option in VLC), well Linux Mint Maya Xfce will not accept any lines more than two, as a custom action from Thunar, at least in my testing. Although it is quite possible I'm overlooking something basic, as I'm a Linux novice!

Overall, there are things I like about Xfce, but I really do miss a lot of the usability and convenience I found in Mate, and didn't have quite so many unusual issues in Mate to my recollection. I know that another fellow has been calling Nadia Xfce the "worst release ever;" that seems pretty harsh. But, when I got myself a laptop there was no question which distro/desktop to install. Linux Mint Maya Mate, and I'm very pleased with it. But I will retain Xfce on my desktop because I've spent so many hours customizing it that it's about as good as Mate in many respects. If I could get this quirk with shell scripts ironed out, and figure out why Xfce won't permanently delete files, that would be nice.

Today it occurred to me that Xfce may be choking because of some atypical system configuration parameter, such as noatime in every entry in my fstab, or tmpfs for /tmp. The perm. remove may depend upon access time or something like that and may break because I optimized the system for efficiency. That would also explain why nobody else has raised their hand and said, "Yeah, this bug happened to me too."
Locked

Return to “Xfce”