BSD socket Programming Help :-(

BSD socket Programming Help :-(

Post by Arcadius A » Tue, 23 Oct 2001 19:24:12



Hello!
I'm writting a little client  and a server for transfering file...

So far , my client can send the  file name  .... and the file is even
created  by the server .... but the content  of the file is printed on the
STD out of the server instead of  the content beeing written in the created
file..... so , the result of my transfer in an empty file whilst its content
is priinted out .... though , I've used "( write ( fd , buf , readSize ) "
were fd is a descriptor of the newly created file..... but ... :-(
there is something I'm doing wrong ... but I cannot see in..... perhaps I'm
a bit tired ......
You can have a look at the codes at http://ahouans.sh.cvut.cz/ctu/dsy/
...... Any help will be appreciated ....

Thanks....

Arcad.

 
 
 

BSD socket Programming Help :-(

Post by Stephen Montgomery-Smit » Tue, 23 Oct 2001 10:58:59


Here is the problem.  The line:
               if ( (fd = open( buf, O_WRONLY | O_CREAT  , 0644) < 0 ))
{
should be
               if ( (fd = open( buf, O_WRONLY | O_CREAT  , 0644)) < 0 )
{

One misplaced bracket.  (An easy mistake when you are tired.)


> Hello!
> I'm writting a little client  and a server for transfering file...

> So far , my client can send the  file name  .... and the file is even
> created  by the server .... but the content  of the file is printed on the
> STD out of the server instead of  the content beeing written in the created
> file..... so , the result of my transfer in an empty file whilst its content
> is priinted out .... though , I've used "( write ( fd , buf , readSize ) "
> were fd is a descriptor of the newly created file..... but ... :-(
> there is something I'm doing wrong ... but I cannot see in..... perhaps I'm
> a bit tired ......
> You can have a look at the codes at http://ahouans.sh.cvut.cz/ctu/dsy/
> ...... Any help will be appreciated ....

> Thanks....

> Arcad.

--
Stephen Montgomery-Smith

http://www.math.missouri.edu/~stephen

 
 
 

BSD socket Programming Help :-(

Post by Arcadius A » Wed, 24 Oct 2001 00:25:08


Thank you very much Stepen !
As you said , the  mistake was with  bracket ......
Now , the file content  is written into the created file on the server .....

Thanks ....

Arcad.


> Here is the problem.  The line:
>                if ( (fd = open( buf, O_WRONLY | O_CREAT  , 0644) < 0 ))
> {
> should be
>                if ( (fd = open( buf, O_WRONLY | O_CREAT  , 0644)) < 0 )
> {

> One misplaced bracket.  (An easy mistake when you are tired.)


>> Hello!
>> I'm writting a little client  and a server for transfering file...

>> So far , my client can send the  file name  .... and the file is even
>> created  by the server .... but the content  of the file is printed on
>> the
>> STD out of the server instead of  the content beeing written in the
>> created file..... so , the result of my transfer in an empty file whilst
>> its content is priinted out .... though , I've used "( write ( fd , buf ,
>> readSize ) " were fd is a descriptor of the newly created file..... but
>> ... :-( there is something I'm doing wrong ... but I cannot see in.....
>> perhaps I'm a bit tired ......
>> You can have a look at the codes at http://ahouans.sh.cvut.cz/ctu/dsy/
>> ...... Any help will be appreciated ....

>> Thanks....

>> Arcad.

 
 
 

1. UNIX Socket Programming Help ! :-(

Hello!
I'm writting a little client  and a server for transfering file...

So far , my client can send the  file name  .... and the file is even
created  by the server .... but the content  of the file is printed on the
STD out of the server instead of  the content beeing written in the created
file..... so , the result of my transfer in an empty file whilst its content
is priinted out .... though , I've used "( write ( fd , buf , readSize ) "
were fd is a descriptor of the newly created file..... but ... :-(
there is something I'm doing wrong ... but I cannot see in..... perhaps I'm
a bit tired ......
You can have a look at the codes at http://ahouans.sh.cvut.cz/ctu/dsy/
...... Any help will be appreciated ....

Thanks....

Arcad.

2. tulip warning fix

3. gcc hugeprogram.c -o hugeprogram.c :-( :-( :-(

4. What Is My IP Address

5. Samba: Can't get browsing to work :-( :-( :-(

6. Anyone get xmcd-1.4 to compile/run under linux, X11R6, Motif 2.0??

7. BSD socket programming reference needed

8. Solaris 8 on Fujitsu-Siemens Primepower

9. BSD Socket programming

10. sending problem in BSD socket programming

11. sending struct data problems in BSD socket program

12. real time and socket-HELP ME PLEASE :-(

13. Problem :-(((((( Help me please:-(((