C++ simple problema

This is a discussion on C++ simple problema within the C++ Programming forums, part of the General Programming Boards category; I am trying to delete and rename a file I get the error Permission Denied what's the problem? The code ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    2

    Exclamation C++ simple problema

    I am trying to delete and rename a file
    I get the error
    Permission Denied
    what's the problem?
    The code looks fine.




    if( remove( "issuer_book_log.txt" ) != 0 )
    perror( "Error deleting file" );
    elseputs( "File successfully deleted" );

  2. #2
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    907
    Your application either doesn't have permission to delete the file, or the file is open. Make sure that the file is not open. If that doesn't work, try running the application as an administrator or super user.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    2
    Thank you! I will follow this

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    What is errno set to after the remove() call fails?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 10:48 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Simple simple program
    By Ryback in forum C++ Programming
    Replies: 10
    Last Post: 09-09-2004, 05:48 AM
  5. Need help with simple DAQ program
    By canada-paul in forum C++ Programming
    Replies: 12
    Last Post: 03-15-2002, 07:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21