home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20117 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.1 KB  |  23 lines

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