LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-26-2004, 02:31 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Rep: Reputation: 15
stdin and NUL. How ?


How do I accept a NUL character through the stdin stream ?
 
Old 10-26-2004, 07:14 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
I don't know if you can. Why do you need to? There's probably another way to do it.
 
Old 10-27-2004, 04:51 AM   #3
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
I was hoping to have a program that would accept piped or console input, and then send it over an RF link. I would then be able to send binary files and upgrades over the RF link.

Mike
 
Old 10-27-2004, 07:38 AM   #4
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
Hmm, I'm not too sure about that then. I think if possibly you get the input with getc () (I'm assuming you're using C / C++ here - please tell me if I'm wrong), then you might be able to it. I'm not really sure though, as the null character is the 'not-a-character' character.
Good luck, anyway!
 
Old 10-27-2004, 09:12 AM   #5
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
'fraid not. getc() seems to filter out NUL.
 
Old 10-28-2004, 07:06 AM   #6
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
OK, the only other thing I can think of is to use fread (), which'll read raw binary data, without trying to interpret it as a character. I'm not sure how easy it would be to use that data then though.
 
  


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
unbuffered stdin Mike Davies Linux - Software 1 03-03-2006 12:13 AM
stdout stdin Furlinastis Linux - Newbie 3 08-11-2005 11:00 PM
Statistics from stdin? edeca Linux - Software 0 05-23-2005 10:03 AM
Cut last 3 characters of stdin? jago25_98 Linux - General 2 09-04-2004 11:04 AM
unbuffered stdin mvt Programming 7 05-17-2004 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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