Logo 
Search:

Networking Articles

Submit Article
Home » Articles » Networking » TCP/IPRSS Feeds

TCP/IP program of wrap-up script filename collection

Posted By: Milind Mishra     Category: Networking     Views: 1841

TCP/IP program of wrap-up script filename collection.

Code for TCP/IP program of wrap-up script filename collection in Networking

#include <sys/file.h>
#include <termios.h>
#include <stdio.h>
#include <string.h>
#include "local.h"externstruct termios    tntty;
externchar        scrname[];
externint        scrindex, errno;

/*ARGSUSED*/int
scrwrap(FILE *sfp, FILE *tfp, int c)
{
    int    fd;

    if (scrindex) {
        scrname[scrindex] = '\0';
        scrindex = 0;
        fd = open(scrname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        if (fd < 0)
            fprintf(tfp, "\ncan't write \"%s\": %s\n",
                scrname, strerror(errno));
        else
            scrfp = fdopen(fd, "w");
    }
    if (tcsetattr(0, TCSADRAIN, &tntty) < 0)
        errexit("tcsetattr: %s\n", strerror(errno));
    return 0;
}
  
Share: 


Didn't find what you were looking for? Find more on TCP/IP program of wrap-up script filename collection Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of TCP/IP program of wrap-up script filename collection is from India.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!