LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2009, 07:09 AM   #1
snailchess
LQ Newbie
 
Registered: May 2009
Posts: 10

Rep: Reputation: 0
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?
 
Old 09-30-2009, 06:17 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Welcome to LQ
Could you give the errormessages?
What happens if you do
Code:
cat /home/user/finance/notes.txt
in a terminal?
 
Old 09-30-2009, 06:59 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Also, try

file /home/user/finance/notes.txt
 
Old 10-01-2009, 04:54 AM   #4
snailchess
LQ Newbie
 
Registered: May 2009
Posts: 10

Original Poster
Rep: Reputation: 0
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:" !
 
Old 10-01-2009, 05:01 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
I tried to reproduce what you did, but no problem here
I use gedit 2.28.0
Perhaps you can try to upgrade
 
Old 10-01-2009, 05:11 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.
 
Old 10-01-2009, 07:22 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
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$
 
Old 10-01-2009, 07:37 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
But mine still does not have the problem. Even the blank line and From on separate line does not make any difference.
 
Old 10-01-2009, 07:43 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
But mine still does not have the problem.
Then your distro/release deals with magic numbers differently.
See here
 
Old 10-01-2009, 07:49 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Will have to go through the link throughly to understand what it says. I am onto Ubuntu 9.04 jaunty now.
 
Old 02-26-2011, 05:57 AM   #11
Pratik Ali
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save text to the beginning of file. c0m4r Linux - General 3 05-24-2009 12:53 PM
Changing file-type of a text file olspookishmagus Linux - General 3 05-03-2006 02:00 AM
wiring to a text file and being able to save and add to it mrobertson Programming 1 07-27-2005 03:27 PM
how to cat a text file and save it as a variable mrobertson Programming 37 07-05-2005 09:20 AM
What is the data type field definition to save RTF file? Linux4BC Linux - General 3 06-02-2004 05:19 AM


All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration