LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2006, 05:12 PM   #1
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Printing from and to a stream


I have a basic question mabye.


is there a function in C that would allow you to read data from a stream to another stream. Or do you have to put the data in some kind of container like a struct or a array ?
 
Old 04-17-2006, 05:18 PM   #2
MichaelZ
Member
 
Registered: Mar 2006
Location: Austria
Distribution: Ubuntu Breezy 5.10
Posts: 32

Rep: Reputation: 15
Hello,

May be this could help:

http://www.cplusplus.com/ref/cstdio/
http://cogsci.ucsd.edu/~batali/gradp...ures/file.html
http://people.cs.uchicago.edu/~ianco...stuff/ccc.html
http://www.aquaphoenix.com/ref/gnu_c..._75.html#SEC75

Best wishes,
Michael
 
Old 04-17-2006, 05:24 PM   #3
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Original Poster
Rep: Reputation: 87
Hmmm well i know how to read text data from one stream put it into something and then write it back to another one. What im lookiing at is if there is a way to move binary data from one file like an .exe to another .exe file. Now this will probably lead somone to saying we wont tell you how to make a viurs or something to that affect. Im just curious if its even possible in C to move data from one binary file to the begining or end of another binary file. Or is this something that can only be done in assembly ?
 
Old 04-17-2006, 05:29 PM   #4
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Yes, definitely. Just open the file using fopen() in binary mode, if you're on Windows. (In Unix, it doesn't matter.) Then just use fgetc() and fputc(). C char types are bytes, so it works just as you would expect it, for copying binary data.
 
Old 04-17-2006, 05:36 PM   #5
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Original Poster
Rep: Reputation: 87
Ohh lol see i thought it was a stupid question.


thanks

i need to stop taking these 3week breaks makeing me stupid
 
  


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
Whats the difference between CUPS printing and Samba shared printing? depam Linux - Software 1 03-17-2006 01:56 PM
TV Stream juniox Linux - Software 1 01-15-2006 02:18 AM
Stream Movies? 0.o Linux - Software 0 01-04-2005 06:15 PM
Scribus Printing How to put 4 flyers on a page when printing jazzboy Linux - Software 0 05-02-2004 06:13 AM
Stream Downloader dustinwu Linux - Software 3 02-24-2004 08:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:02 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