LinuxQuestions.org
Visit Jeremy's Blog.
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 01-06-2006, 10:39 AM   #1
sahel
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Rep: Reputation: 15
Question named pipe


How can i handle space in scanf?
ex i have this:
if((t=open(fdname,O_WRONLY)) == -1)
{
printf("error\n");
goto test1;
}

printf("Enter your recipiant:\n");
scanf("%s",&z);

write(t,z,strlen(z));
but when i want to read from this pipe , the read content is different from what i have written
thnaks

Last edited by sahel; 01-08-2006 at 02:10 AM.
 
Old 01-09-2006, 08:29 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 224Reputation: 224Reputation: 224
in what way?
what data type is z?

better (IMO) fgets
will get the whole line up to \n

Last edited by bigearsbilly; 01-09-2006 at 08:31 AM.
 
  


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
syslog not opening named pipe. fluxrad Linux - Software 5 02-10-2009 05:31 AM
pass a string to a named pipe sahel Programming 1 01-05-2006 07:52 PM
Transphering files over a remote named pipe breik Linux - Networking 1 10-02-2005 01:10 PM
connecting two vm machine via named pipe ? cyu021 Linux - Software 2 03-21-2005 07:01 PM
Virtual Host type, named or IP via SSL? Named VH is not possible? piratebiter Linux - Security 3 08-20-2003 05:27 PM

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

All times are GMT -5. The time now is 02:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration