opening text files
Tofloor
poster avatar
pac
deepin
2017-07-10 00:22
Author
is there a way for deepin to stop prompting users to run or display text files? why not just open it automatically with a text editor?

Reply Favorite View the author
All Replies
aName
deepin
2017-07-10 01:05
#1
Maybe it's a script file with executable permissions,「  chmod 644 filename  」will  meet your demand.
Reply View the author
pac
deepin
2017-07-10 03:34
#2
will this work for all txt files?
Reply View the author
aName
deepin
2017-07-10 04:05
#3
of course not. In fact,it's a necessary function for OS.   「 chmod 644  filename 」will only effect file whose name is placed in [filename]
Reply View the author
pac
deepin
2017-07-10 17:36
#4
previous versions of deepin allowed directly opening txt files. many other linux also do that.
Reply View the author
baoding-fenshuajiang_Odoo
deepin
2017-07-10 18:02
#5
The user can open the text file,this means the user have the right to read the text file.
The trouble is the user cann't open the text files direcly,
The system prompt users to run or display text file,the user must select one of it.
The user want to open it automatically with a text editor.
Reply View the author
海天鹰
deepin
2017-07-10 18:05
#6
I agree with you !
Reply View the author
th3blad3runn3r
deepin
2017-07-13 11:49
#7
Could you please tell us if this entry exists while right clicking on your file within deepin file manager ?
Reply View the author
wtz
deepin
2017-07-13 16:40
#8
https://bbs.deepin.org/post/142261
Could you please tell us if this entry exists while right clicking on your file within deepin file m ...

No matter there is file association or not, deepin file manager will prompt to execute the file once it has execute permission. Same situation can be found among most of the other distros.

This is an annoying "feature" which have annoyed many Linux newbies (and me) for many years. They simply regard that the "execute" attribute should only belong to EXE files (i.e. files with PE header), and simply could not understand how a TXT file can be executed.

Besides, a lot of the scripts with execute permission do not expect they are launched directly by file manager.

So, while Windows trying to decide opening method by quering in register the file prefix, I suggest deepin file manager (as well as other FM) to step a little bit further into the file content, perhaps by using "file" command, to determine if it is a real binary executable, or scripts with "#!" prompt, or real "plain" text.
Reply View the author
nipos
deepin
2017-07-13 23:46
#9
I think it will also look for file permissions.
If you give it only read and write rights (no execute) it should directly open the text editor without asking to run it.
While default permissions should be 755,you have to change it to 644.
Do that with the terminal with the command "chmod 644 file.txt" or simply uncheck the execute rights in the file detail window in Deepin filemanager.
Do NOT run chmod recursively as it would make portable applications unusable.
You can also change your systems umask to 0133 (what gives the files 644 permissions by default) but I don't know if this takes effect on newly installed applications or updates.
Do that by editing the file /etc/profile with root rights (sudo gedit /etc/profile)
Reply View the author
wtz
deepin
2017-07-14 01:29
#10
https://bbs.deepin.org/post/142261
I think it will also look for file permissions.
If you give it only read and write rights (no execut ...

Files in FAT/NTFS device automatically mounted by udisksctl will gain 777 permission.
Although you can change "umask" option in udev rules, this is not expected to be done by "normal" user (who does not want to step any further info the system).
Reply View the author
th3blad3runn3r
deepin
2017-07-14 03:31
#11
https://bbs.deepin.org/post/142261
No matter there is file association or not, deepin file manager will prompt to execute the file on ...

I  agree with you regarding files with the "execute" rights set, but what pac seems to say, this occurs whatever permissions are set.
Pac, could you please confirm the permission mask in use with those files ?
If 7xx, then wtz is right
Reply View the author