Thread: c++ equivalent of remove and rename

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    113

    c++ equivalent of remove and rename

    What is c++ equivalent of remove and rename macro of c used for removing and renaming a particular file respectively.

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291
    maybe you can use the 'system("")' function to execute dos commands. I usually work with the windows.h header, so I can use the win32 api functions DeleteFile() and CopyFile() to simplify the work.
    niara

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    there are no standard c++ equivalents -- use remove() and rename(). The win32 api functions previously mentioned are not c++ either, but C functions so that they can be called by several different computer languages.

  4. #4
    Rabble Rouser Slacker's Avatar
    Join Date
    Dec 2005
    Posts
    116
    What is c++ equivalent of remove and rename macro of c used for removing and renaming a particular file respectively.
    The C++ equivalents of remove and rename are remove and rename. The entire standard C library is also a part of the standard C++ library, so include <cstdio> and use std::remove and std::rename. How's that for a simple solution?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Running remove() gets permission denied error...
    By edomingox in forum C Programming
    Replies: 4
    Last Post: 01-11-2009, 12:55 PM
  2. remove() and rename()
    By LiKWiD in forum C++ Programming
    Replies: 10
    Last Post: 03-21-2005, 10:35 PM
  3. Hex Editing - Remove first 15 bytes
    By xTrinity in forum C++ Programming
    Replies: 13
    Last Post: 08-13-2003, 09:01 PM