[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] cd erstatning



Følgende virker næsten mage til cd

Den Kasse skulle kunne scores..
Hans-Christian Stadler
--------------------------------------------------------------
#include <iostream>
#include <cerrno>
#include <cstdio>
#include <sys/ioctl.h>

using namespace std;

int main (int argc, char *argv[])
{
        const int MAX_STR = 128;
        char cmd[MAX_STR], *inp=cmd;
        const char *arg = argc > 1 ? argv[1] : "";
        if (snprintf(cmd, MAX_STR, "cd %s\n", arg) >= MAX_STR)
                cerr << "Error: Cannot handle long dir names" << endl, exit(-1);
        while (*inp)
                if (ioctl(STDIN_FILENO, TIOCSTI, inp++))
                        cerr << "Error: " << strerror(errno) << endl, exit(-1);
}



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-01-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *