LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 06: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, 05:17 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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, 05:59 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Also, try

file /home/user/finance/notes.txt
 
Old 10-01-2009, 03: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, 04:01 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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, 04:11 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 06:22 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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, 06:37 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 06:43 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
But mine still does not have the problem.
Then your distro/release deals with magic numbers differently.
See here
 
Old 10-01-2009, 06:49 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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, 04: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



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 11:53 AM
Changing file-type of a text file olspookishmagus Linux - General 3 05-03-2006 01:00 AM
wiring to a text file and being able to save and add to it mrobertson Programming 1 07-27-2005 02:27 PM
how to cat a text file and save it as a variable mrobertson Programming 37 07-05-2005 08:20 AM
What is the data type field definition to save RTF file? Linux4BC Linux - General 3 06-02-2004 04:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:34 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
Open Source Consulting | Domain Registration