Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>unlink</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
unlink

Usage

   #include <io.h>
   int unlink(const char *filename);

Description

   unlink deletes the file specified by the string filename.

Example 

   #include <stdio.h>
   #include <io.h>
   #include <stdlib.h>

   int main()
   {
       int value;
       char buffer[13];
       char *result;

       printf("Input file to remove: ");
       result = gets(buffer);
       value = unlink(result);
       if(value == 0) {
           printf("Erased [%s] from disk\n",result);
           return EXIT_SUCCESS;
       } else {
           printf("Unable to erase [%s]\n",result);
           return EXIT_FAILURE;
       }
   }


Return Value

   Returns 0 if the file was successfully deleted or -1 if an error
   occurred and errno is set.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson