Thread: renaming file without rename() function?

  1. #1
    Registered User subodh_dg's Avatar
    Join Date
    Mar 2005
    Location
    Nagpur, India
    Posts
    4

    Question renaming file without rename() function?

    I want to know how rename function work. Can we access the information of file such as it's attributes,size just by giving it's name.
    Please help me

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >>I want to know how rename function work.
    Depends on the OS.

    >> Can we access the information of file such as it's attributes,size
    Yes. Depends on the OS.

    gg

  3. #3
    Registered User subodh_dg's Avatar
    Join Date
    Mar 2005
    Location
    Nagpur, India
    Posts
    4
    Quote Originally Posted by Codeplug
    >>I want to know how rename function work.
    Depends on the OS.

    >> Can we access the information of file such as it's attributes,size
    Yes. Depends on the OS.

    gg
    Can u plz tell me for Win98 and linux These r 2 OSs i am using

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Windows:
    MoveFile[Ex]()
    GetFileAttributes[Ex]()

    *Nix (POSIX)
    rename() (standard C as well)
    [f]stat()


    Your standard C implementation being used on Windows should have rename() as well. stat() is also typically available (depending on your compiler/libraries).

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM