Why Gedit thinks my notes are "executable text files" ?

Asked by Wladston Viana on 2006-09-26

I wonder why Gedit keeps thinking that the notes I create are "executable text files", since they don't have the .sh ending.

If I configure gedit not to ask to execute, the .sh files won't execute anymore :(

Anyone can help me ?

Thanks! ;)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Solved by:
Chris Kirk
Solved:
2006-10-03
Last query:
2006-10-03
Last reply:
2006-10-03
Chris Kirk (sktx) said : #1

It's likely that your notes file has executable permissions. If that's the problem, it can be fixed by typing...

chmod a-x /path/to/notes/file.txt

...into a terminal window or at the console. Of course, you'll remember to change /path/to/notes/file.txt to the actual path to your notes file ;)

-Chris.

Just right click on the file, go to properties, select the permissions tab and then make sure the executable boxes are NOT checked. :)

Wladston Viana (wladston) said : #3

Oh - this was it - thanks guys!

Now, please, allow me to change the question : Why is ubuntu detecting my simple txt files as executables, and, is there a way for him to mark my .txt text files as "not executable" automaticaly ?

Did they come from Windows? Are they on a Windows "shared drive"? Since Windows doesn't have an executable bit, Linux treats all Windows (or SMB-shared) files as executable, just in case.

If these comments answered your question, please consider closing this ticket. If not, please let us know and we'll keep working with you to resolve your issue.

Thanks

Good Luck

Jim Jones

Wladston Viana (wladston) said : #6

Yeah - they did come from windows - from my backup before wiping the windows partition....

But tell me .... no executable on windows runs at Ubuntu, so I really don't get the point in assuming the windows files are executable files.... Why not to treat the files (specially the ones that end with .txt) as non-executable files ?

Why / why not? I'm not really sure... that's a question for the Samba
developers. I think that Windows *does* have separate "Read" and "Read &
Execute" permissions, but they're never really used (or something like
that... I'm certainly no expert).

Anyway, to remove the executable bit from a whole tree, run the following:

chmod -x `find /path/to/files -type f`

Note the use of backticks, not single quotes...

Wladston Viana (wladston) said : #8

well, the files I'm refering to are not on a windows dir - they were copyed from the old "my documents" folder ....

Thanks for the hint, it was very usefull!

So you mean that the Ubuntu developers _wanted_ this problem to happen ? Ubuntu trying to execute windows text files ?

Wladston Viana (wladston) said : #9

This is what I get :
wladston@wlad:~$ chmod -x `find ~ -type f`
bash: /bin/chmod: Argument list too long

You should use:
$ find path/to/files -type f -print0 | xargs -0 chmod -x

Although, be careful while changing file permissions.

I think it's possible to ignore the executable bit for file on Windows partitions. I'm not sure, exactly how, but it would involve setting the correct masks in /etc/fstab

Try:
$ gksudo gedit /etc/fstab

Locate the line for your Windows partition. And change it, so it looks like this:
/dev/[xxx] /media/windows ntfs user,fmask=0111,dmask=0000 0 0

Change [xxx] for the device name of the partition. If you're using an older version of Windows (prior Windows 2000), the partition type should be `vfat' not `ntfs'.

P.S. Try opening a new request, when you got a new question.

Wladston Viana (wladston) said : #11

ok, thanks!

It's not actually a windows partition, the filesystem is ext3, but these files were copyed from the windows partition....

I guess my ideas are more like a request - I'll create one.

Bernhard (b.a.koenig) said : #12

Actually, I agree with Wladston. Files should not be executable just because they come from a FAT partition.