Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-14-2013, 09:18 PM   #1
LQ Newbie
Registered: Oct 2013
Posts: 1

Rep: Reputation: Disabled
Angry How did my text file turn into a binary file

Hello Linux experts,

I have been using Cygwin on my laptop and editing on notepad. I was working on a c++ program for school and suddenly when I tried to look at the text file by using the command notepad assign3.c in Cygwin the screen filled with garbage. So I tried the command less assign3.c in Cygwin and the system told me that the file was a binary file and asked if I wanted to see it anyway. How did this get changed to a binary file and is there a way to change it back. I made no back-up so I will need to start over if I can't retrieve it.

Other text files that I open are fine still. It is just this particular file that seems to be changed to binary.
Old 10-14-2013, 09:24 PM   #2
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,800
Blog Entries: 6

Rep: Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612
It is likely that you overwrote it some way.

Since it is a C source file, did you maybe mistakenly direct compiler output to that filename?
Old 10-14-2013, 09:28 PM   #3
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 4,047

Rep: Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798
Most likely because at some point you were compiling it and mistakenly typed "-o assign3.c" instead of "-o assign3" or "-o assign3.o". In any event, it's gone now. De-compiling won't give you anything like your original source file.

(Beaten to the punch, I see.)


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
scp truncate text file busy - copying file is not a running binary jetberrocal Linux - Server 3 06-24-2010 04:56 PM
Reading text file-writting binary file cdog Programming 5 06-13-2006 12:56 PM
What 's the different between text file and binary file? taureanyang General 3 07-25-2005 09:37 AM
Automatically tell text file from binary file? Hosiah Linux - Software 3 05-31-2005 06:22 AM
convert text file to binary excel file ust Linux - General 2 11-23-2004 03:33 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:22 PM.

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