LinuxQuestions.org
Review your favorite Linux distribution.
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 05-12-2001, 05:47 PM   #1
justin19fl
Member
 
Registered: Apr 2001
Location: Pensacola, Florida
Distribution: Red Hat 9
Posts: 42

Rep: Reputation: 15

How can I concatenate two binary files. They were originally split with a file-splitter so that they would fit on floppies. The file-splitter created a batch file to put them back together. The batch file uses this command: "copy /B file1 + file2 file3" (without quotes). I looked at the man page for cat, but I didn't see any parameters to use for binary files. What should I do?
 
Old 05-12-2001, 05:53 PM   #2
justin19fl
Member
 
Registered: Apr 2001
Location: Pensacola, Florida
Distribution: Red Hat 9
Posts: 42

Original Poster
Rep: Reputation: 15
The whole reason I got into this mess is that I can't get online with Linux (My parents use AOL ), and because I can't access my DOS disk from Linux. If anyone knows of a free ISP for Linux or a way to access my DOS disk, please help. Please explain in as simple terms as you can because I'm new to Linux.
 
Old 05-13-2001, 04:26 PM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Not sure about the concatenating, but:

First, think back - when you repartitioned your HD, did you erase your Windows partition(s)? If the answer is yes, then I'm affraid that you've lost all of the files that were under Windows. If the answer is no, then don't stress.

Using Konqueror (the program that behaves like Windows Explorer) move to your '/mnt' directory. Are there any subdirectories called 'windows' or 'win_c' or the like? You should already have a 'cdrom', 'floppy' and 'disk' (I'm not sure what this last one's for). If you have, and it has a padlock over it, log in as root. If you can now access it, then there you go. It's here!

If there aren't any subdirectories called 'windows' or 'win_c' then make one. Make sure you're logged in as root. Open a terminal window and type:

mount vfat /hda1 /mnt/windows

You should be able to access it now. This is only a temporary measure, you need to read up about your 'fstab' for a more permanent solution. Either look for a HowTo on 'fstab' or type 'man fstab' from a terminal window.

Can't be of anymore help tonight, my university computer turns itself off at 22:30 GMT (4 mins time).

Good luck anyway.
 
Old 05-13-2001, 05:56 PM   #4
justin19fl
Member
 
Registered: Apr 2001
Location: Pensacola, Florida
Distribution: Red Hat 9
Posts: 42

Original Poster
Rep: Reputation: 15
Ok, I figured out how to access my Windows disk. I used linuxconf instead of your mount command so it leaves an icon on my desktop to automatically mount and open gmc, but I still want to know how I can concatenate binary files, and I'm still looking for a free ISP.
 
Old 05-14-2001, 09:44 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
I'm no great programmer (hence the 'Basic Under Linux' thread) but I believe that this should work:

Copy the 1st bin to a new one and then append the second to it, like:

cp filea.bin newfile.bin
cat fileb.bin >> newfile.bin


The double '>>' is important. A single '>' will overwrite the contents of 'newfile.bin' with 'fileb.bin', so you won't have achieved much!

Don't forget to change the file permissions so that you can run the 'newfile.bin'.
 
Old 05-14-2001, 02:10 PM   #6
justin19fl
Member
 
Registered: Apr 2001
Location: Pensacola, Florida
Distribution: Red Hat 9
Posts: 42

Original Poster
Rep: Reputation: 15
Ok, I know that doesn't work in DOS, but maybe Linux does it differently. With DOS you will automatically get an EOF code at the end of the FIRST binary file, along with the EOF code at the end of the end of the second (creating a binary with 2 EOF codes). If I remember correctly it isn't good to even have 1 EOF code in a binary file, but I'm not sure how Linux treats ascii and binary files, so that could work.
 
Old 05-14-2001, 02:13 PM   #7
justin19fl
Member
 
Registered: Apr 2001
Location: Pensacola, Florida
Distribution: Red Hat 9
Posts: 42

Original Poster
Rep: Reputation: 15
The DOS command is COPY /B FILE1 + FILE2 FILE3. The /B switch causes it to copy in binary mode, but Linux might already copy in binary mode by default.
 
  


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
Concatenate binary file iftiuk Linux - General 6 05-16-2005 08:11 AM
Binary Files? Teralon 9 Linux - General 2 02-10-2004 10:36 PM
Using binary files KDE4me Linux - Newbie 1 04-24-2003 08:00 AM
Binary Files guywithredhat Linux - General 7 03-18-2003 06:28 PM
binary files walterw Programming 7 01-27-2003 08:27 AM

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

All times are GMT -5. The time now is 12:24 AM.

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