Labeling a .txt file permanently non-executable?

AmigaOne X5000 platform specific issues related to Linux only.
Post Reply
Roland
Posts: 397
Joined: Tue May 02, 2017 7:23 am

Labeling a .txt file permanently non-executable?

Post 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...
- Roland -

caseycullen
Posts: 332
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

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

Post 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.

Roland
Posts: 397
Joined: Tue May 02, 2017 7:23 am

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

Post 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.
- Roland -

caseycullen
Posts: 332
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

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

Post 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?

Roland
Posts: 397
Joined: Tue May 02, 2017 7:23 am

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

Post 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.
- Roland -

caseycullen
Posts: 332
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

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

Post 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.

Roland
Posts: 397
Joined: Tue May 02, 2017 7:23 am

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

Post 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.
- Roland -

Post Reply