LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2020, 07:05 PM   #31
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,655

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363

Quote:
DONTDELETE has no write permissions, so its entries can't be moved or removed.
DONTDELETE itself can't be moved or removed because its entries can't be moved or removed.
This why it can't be moved to Trash.
 
Old 02-24-2020, 10:24 PM   #32
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,362

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
Quote:
Originally Posted by l0f4r0 View Post
So if you want to move ~/Downloads/DONTDELETE to ~/.local/share/Trash, you just need write permission on both ~/Downloads and ~/.local/share/Trash?
Indeed, you would. The DONTDELETE directory contains a link ".." that points to its parent directory. Lacking write permission in DONTDELETE, you can rename it within the Downloads directory, but cannot move it to a different parent, since that would require changing that ".." link. And of course you also need write permission in both the old and new parent directories.
 
Old 02-25-2020, 05:46 AM   #33
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,195

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by l0f4r0 View Post
So if you want to move ~/Downloads/DONTDELETE to ~/.local/share/Trash, you just need write permission on both ~/Downloads and ~/.local/share/Trash?
Just to summarize (for future readers etc)
To move a directory to trash you'll need:
- write access to the directory itself (to change its .. entry)
- write access to the parent directory (to remove its entry there)
- write acces to the trash directory (to add a new entry in there)

So creating a DONOTDELETE directory and making it read-only will prevent its contents and that dir itself from being removed OR moved to the trash.
 
Old 02-25-2020, 07:15 AM   #34
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 898

Original Poster
Rep: Reputation: 288Reputation: 288Reputation: 288
Quote:
Originally Posted by JeremyBoden View Post
This why it can't be moved to Trash.
Sorry for that, I don't know why I wrote that to you (I must have been tired)...


Quote:
Originally Posted by rknichols View Post
Indeed, you would. The DONTDELETE directory contains a link ".." that points to its parent directory. Lacking write permission in DONTDELETE, you can rename it within the Downloads directory, but cannot move it to a different parent, since that would require changing that ".." link. And of course you also need write permission in both the old and new parent directories.
Thanks everybody for your appreciated help.
I have now a simple&working solution.


Quote:
Originally Posted by ehartman View Post
Just to summarize (for future readers etc)
To move a directory to trash you'll need:
- write access to the directory itself (to change its .. entry)
- write access to the parent directory (to remove its entry there)
- write acces to the trash directory (to add a new entry in there)

So creating a DONOTDELETE directory and making it read-only will prevent its contents and that dir itself from being removed OR moved to the trash.
Yes and just to answer my OP: suppression by GUI (Thunar...) is equal to "move to trash", not "deletion" in the strict sense of the term
Thread [SOLVED].

Last edited by l0f4r0; 02-25-2020 at 08:18 AM.
 
  


Reply

Tags
permission


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trash is Full. Empty Trash before moving more files/folders to Trash. wdarledge Slackware 45 12-13-2017 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration