Thread: How to delete a file?

  1. #1
    Registered User Seek n Destroy's Avatar
    Join Date
    Sep 2002
    Posts
    9

    Question How to delete a file?

    I need to delete a file from de hard disk.
    Like c:\example.txt

    Can anybody tell me how to do it?
    Thanxs
    Seek n destroy

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    you can make a system call and call rm, i think you use a pointer to the filename in this case
    Monday - what a way to spend a seventh of your life

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Code:
    //stdio.h:
    int remove(const char *filename);
    
    //example
    remove("old c project.c");

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM