Page 1 of 1

Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 5:15 pm
by Roland
How could I make a .txt file permanently 'non-executable'? When I open certain text files, system asks every time whether they should be executed or just opened! For a 'notepad file' which I open and edit several tens of times every day, this can VERY annoying...

Re: Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 5:40 pm
by caseycullen
Roland wrote:How could I make a .txt file permanently 'non-executable'? When I open certain text files, system asks every time whether they should be executed or just opened! For a 'notepad file' which I open and edit several tens of times every day, this can VERY annoying...
Right click on the file and go to properties, there's a check box that labels it as executable, uncheck it.

Re: Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 7:35 pm
by Roland
caseycullen wrote:
Roland wrote:How could I make a .txt file permanently 'non-executable'? When I open certain text files, system asks every time whether they should be executed or just opened! For a 'notepad file' which I open and edit several tens of times every day, this can VERY annoying...
Right click on the file and go to properties, there's a check box that labels it as executable, uncheck it.
That's what I have already tried, but 'unchecking' is not working... The tick reappears there as soon as I reliese the mouse button! And opening the dir where the file is located as 'administrator' does not make any change.

Re: Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 7:49 pm
by caseycullen
Roland wrote:
caseycullen wrote:
Roland wrote:How could I make a .txt file permanently 'non-executable'? When I open certain text files, system asks every time whether they should be executed or just opened! For a 'notepad file' which I open and edit several tens of times every day, this can VERY annoying...
Right click on the file and go to properties, there's a check box that labels it as executable, uncheck it.
That's what I have already tried, but 'unchecking' is not working... The tick reappears there as soon as I reliese the mouse button! And opening the dir where the file is located as 'administrator' does not make any change.
Is the file on an NTFS structure or was it copied from one?
Can you try "chmod -x <file>" in terminal?

Re: Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 8:43 pm
by Roland
caseycullen wrote: Is the file on an NTFS structure or was it copied from one?
Can you try "chmod -x <file>" in terminal?
It is on a NTFS partition if you mean that, but do not remember how it was originally created.

That 'chmod -x' <file> gives nothing on screen.

Re: Labeling a .txt file permanently non-executable?

Posted: Thu Jan 23, 2020 9:30 pm
by caseycullen
Roland wrote:
caseycullen wrote: Is the file on an NTFS structure or was it copied from one?
Can you try "chmod -x <file>" in terminal?
It is on a NTFS partition if you mean that, but do not remember how it was originally created.

That 'chmod -x' <file> gives nothing on screen.
Ah, that makes sense. This is normal behaviour for NTFS partitions. NTFS has no ownership/permission bits, which is also how Linux records if a file is executable or not. You can set the entire partition to "not execute" in fstab if you'd like; see this.

Re: Labeling a .txt file permanently non-executable?

Posted: Sat Jan 25, 2020 11:45 am
by Roland
caseycullen wrote:
Roland wrote:
caseycullen wrote: Is the file on an NTFS structure or was it copied from one?
Can you try "chmod -x <file>" in terminal?
It is on a NTFS partition if you mean that, but do not remember how it was originally created.

That 'chmod -x' <file> gives nothing on screen.
Ah, that makes sense. This is normal behaviour for NTFS partitions. NTFS has no ownership/permission bits, which is also how Linux records if a file is executable or not. You can set the entire partition to "not execute" in fstab if you'd like; see this.
I figured out that much better way would be to use some other postfix than '.txt' for those files which system sees as potentially executable. Can you advice a postfix of some otherwise rarely used filetype which could be used for this purpose? It does not need to be really a text format, as it is enough to point e.g. Pluma to open all files of that 'type'!

I already tested that the trick works with '.doc', but as I occasionally encounter also real word documents, it is unpractical to assign them to open in Pluma.