Tweeted twitter.com/#!/StackUnix/status/582309135468879873
4 edited title
| link

Setting correct permissions automatically for certain file type when file is copied from non-Linux partitionfile system

3 had no idea we've got a permissions tag!
| link
2 edited title
source | link

Setting correct permissions automatically for certain file type when file is copied from NTFSnon-Linux partition

The main reason I want this is my heavy use of dircolors, especially for ls --color=auto. For example, whenever a .mp3 file is copied from NTFS, it will have permissions set by umask 022 which ought to be standard value in most modern distros. However, for audio files this makes no sense: due to the fact that their permissions get set to 755 (rw-rrwxr-xr-x), they will get the same color as an executable shell script, while I'd really like to have this color reserved for true executables. This is not Windows; even with the x permission set for owner/group/other you cannot expect ./track1.mp3 to work in terminal so that it make an attempt to pick a default console player.

So I'd like to have a certain umask ONLY for audio files, i. e. that any files like .mp3, .wav, .ogg and so on would always get set their mode to 644, while leaving all other files copied to this place at their default umask of 022.

Is there any way to accomplish this?
(NOTE: cp --preserve will NOT preserve original permissions on NTFS either, since NTFS is notoriously ignorant about *NIX permission systematic.)

Setting correct permissions automatically for certain file type when file is copied from NTFS partition

The main reason I want this is my heavy use of dircolors, especially for ls --color=auto. For example, whenever a .mp3 file is copied from NTFS, it will have permissions set by umask 022 which ought to be standard value in most modern distros. However, for audio files this makes no sense: due to the fact that their permissions get set to 755 (rw-r-xr-x), they will get the same color as an executable shell script, while I'd really like to have this color reserved for true executables. This is not Windows; even with the x permission set for owner/group/other you cannot expect ./track1.mp3 to work in terminal so that it make an attempt to pick a default console player.

So I'd like to have a certain umask ONLY for audio files, i. e. that any files like .mp3, .wav, .ogg and so on would always get set their mode to 644, while leaving all other files copied to this place at their default umask of 022.

Is there any way to accomplish this?

Setting correct permissions automatically for certain file type when file is copied from non-Linux partition

The main reason I want this is my heavy use of dircolors, especially for ls --color=auto. For example, whenever a .mp3 file is copied from NTFS, it will have permissions set by umask 022 which ought to be standard value in most modern distros. However, for audio files this makes no sense: due to the fact that their permissions get set to 755 (rwxr-xr-x), they will get the same color as an executable shell script, while I'd really like to have this color reserved for true executables. This is not Windows; even with the x permission set for owner/group/other you cannot expect ./track1.mp3 to work in terminal so that it make an attempt to pick a default console player.

So I'd like to have a certain umask ONLY for audio files, i. e. that any files like .mp3, .wav, .ogg and so on would always get set their mode to 644, while leaving all other files copied to this place at their default umask of 022.

Is there any way to accomplish this?
(NOTE: cp --preserve will NOT preserve original permissions on NTFS either, since NTFS is notoriously ignorant about *NIX permission systematic.)

1
source | link