How can i forbid file deletion but allow file addition in a dir ?
How do i assign custom permission (that depends upon its dirname) to newly created file ?
Had about 7 gig of music files on my Nexus 10 leaving me something over 5 gig storage free. Decided to delete all those music files. Deleted 7 Gb. Then Checked Nexus expecting to now find 12 Gb free storage. Files have gone but Nexus still showing no storage released after the file deletion with just the original 5 gig free.
From java, I use the following code to create a file:
File dirName = new File("/var/www/html/nyk/app/webroot/MusicDB/music.db");
But the file gets created with a 'lock symbol' on top of it which indicates restricted permissions. I am able to change the permissions of this file manually from terminal using cgmod -R 777 filename .
i want to catch a temp file with dynamic name created by a program that is available only for some milliseconds. For this i probably need some permissions like this: Create/modify but no delete.
I can do this with NTFS but on ext4 it seems impossible. Chattr +i +u or setting folder to sticky seems useless.