LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gedit cannot save text file, type mailbox file ! (https://www.linuxquestions.org/questions/linux-newbie-8/gedit-cannot-save-text-file-type-mailbox-file-756355/)

snailchess 09-19-2009 06:09 AM

gedit cannot save text file, type mailbox file !
 
I am using debian 10.

lately gedit cannot do the simple task of starting/saving a simple new text file!

Type become "mailbox file". Is my computer hacked into?

error: couldn't display "/home/user/finance/notes.txt

Is it all the updates giving problem?

repo 09-30-2009 05:17 PM

Welcome to LQ
Could you give the errormessages?
What happens if you do
Code:

cat /home/user/finance/notes.txt
in a terminal?

chrism01 09-30-2009 05:59 PM

Also, try

file /home/user/finance/notes.txt

snailchess 10-01-2009 03:54 AM

What I found is an unusual bug in gedit. The actual problem is finally nailed to this:-

If I have a text file like notes.txt in my home directory /home/user/notes.txt, then after a new session with graphical login/password, etc, I could access my "notes.txt" by just double clicking on the file.

eg notes.txt (same as I cut and save as follow) :-
"An estimate by the World Gold Council is that all the gold ever mined totaled 158,000 tonnes, which when valued at USD1000/oz is worth USD5.1 trillion.
.....
"
If I edit it to :-
"From wiki:An estimate by the World Gold Council is that all the gold ever mined totaled 158,000 tonnes, which when valued at USD1000/oz is worth USD5.1 trillion.
.....
"
and finally save the file, it becomes a "mailbox file" type!
Then it will fail to open with a simple double click, giving a error message :-
"Couldn't display /home/user/notes.txt".

So the quirky stuff is gedit text files cannot begin with "From wiki:" !

repo 10-01-2009 04:01 AM

I tried to reproduce what you did, but no problem here
I use gedit 2.28.0
Perhaps you can try to upgrade

linuxlover.chaitanya 10-01-2009 04:11 AM

No issues with mine as well. Mine gedit is 2.26.1.
Tried what you say but it saves as text file. You may be changing the file type or it might have got changed somehow without your knowledge.

tredegar 10-01-2009 06:22 AM

Quote:

and finally save the file, it becomes a "mailbox file" type!
Unlike windows (which uses extensions) linux looks inside the file to try to determine what sort of file it is, and then tries to associate it with the appropriate application:

If the first line starts with From: then it is treated as a mail file.

See here:
Code:

tred@vaio:~/Documents$ cat foo
                  <- Notice the blank line here
From: wiki
rubbish
tred@vaio:~/Documents$ cat foo2
From: wiki
rubbish
tred@vaio:~/Documents$ file foo
foo: ASCII text
tred@vaio:~/Documents$ file foo2
foo2: news or mail text
tred@vaio:~/Documents$


linuxlover.chaitanya 10-01-2009 06:37 AM

But mine still does not have the problem. Even the blank line and From on separate line does not make any difference.

tredegar 10-01-2009 06:43 AM

Quote:

But mine still does not have the problem.
Then your distro/release deals with magic numbers differently.
See here

linuxlover.chaitanya 10-01-2009 06:49 AM

Will have to go through the link throughly to understand what it says. I am onto Ubuntu 9.04 jaunty now.

Pratik Ali 02-26-2011 04:57 AM

Quote:

Originally Posted by tredegar (Post 3703340)
Unlike windows (which uses extensions) linux looks inside the file to try to determine what sort of file it is, and then tries to associate it with the appropriate application:

If the first line starts with From: then it is treated as a mail file.

See here:
Code:

tred@vaio:~/Documents$ cat foo
                  <- Notice the blank line here
From: wiki
rubbish
tred@vaio:~/Documents$ cat foo2
From: wiki
rubbish
tred@vaio:~/Documents$ file foo
foo: ASCII text
tred@vaio:~/Documents$ file foo2
foo2: news or mail text
tred@vaio:~/Documents$


That solves it from me. Just delete the 'From' at the beginning of the text, and it's no longer an mbox file.


All times are GMT -5. The time now is 05:41 PM.