Posted by : ANIMESH SHAW Monday, 6 February 2012


 #include<stdio.h>   
 #include<dos.h>   
 #include<stdlib.h>   
 #include<process.h>

 const char * const path = "d:/popsys/test";  
 const char * const file = "lernc.txt";  
   
 int main () {  
    printf ("Changing directory to <%s>\n", path);  
      
    if (chdir (path) == -1) {  
        printf ("chdir failed - %s\n", strerror (errno));  
    }else {  
        printf ("chdir done !!!\n");  
        printf ("directory content of '%s'\n\n", path);  
        system ("ls -l");  
        printf ("\n");  
        printf ("checking the content of '%s'\n", file);  
        system ("cat lernc.txt");  
    }  
    return 0;  
 }  

Popular Post

Total Pageviews

Sign In

Follow by Email

Powered by Blogger.

Like Us on Facebook

Search This Blog

Loading...

Indian Coder

- Copyright © Programming Mania -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -