home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!pardee
- From: pardee@cs.uiuc.edu (Jason Pardee)
- Subject: File manipulation from a program...PLEASE HELP!
- Message-ID: <C1BH3B.5pD@cs.uiuc.edu>
- Sender: news@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- Date: Sat, 23 Jan 1993 17:11:34 GMT
- Lines: 12
-
- i want to know if there is a way to rename a file from a C program. you know,
- the equivalent of the command 'ren ldfilename> <newfilename>'. is there
- such a function in C? if not, is there a way to invoke a DOS command from
- within a program, meaning, is there a way i can execute the 'ren' command
- inside my program?
-
- what i want to do is alter some files but keep the same name for the files.
- the only way of doing this with my knowledge is creating a new temporary file,
- copying the file i want to alter to the temp file, delete the target file,
- then recopy the temp file's contents with the proper changes back to
- a file with the same name as the one i started with. is this clear? i hope
- i can get some help on this soon. thanks in advance.
-