home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / dirutl / dirutils.arc / CN.DOC < prev    next >
Encoding:
Text File  |  1987-12-14  |  1.7 KB  |  46 lines

  1. Docs for Cn.com - change name utility
  2. R. Trevithick, 12/12/87
  3.  
  4.  
  5. This  program  allows  single  file  and  directory  names  to be
  6. changed.
  7.  
  8. The program is coded to simply call the  DOS 56h  rename service,
  9. which handles  all the  details.   I wrote  this merely because I
  10. needed a way of renaming sub-directories - which Dos supports but
  11. the rename command doesn't.  Using DEBUG or the Norton Utilities 
  12. for this was much too tedious...
  13.  
  14.         The syntax is cn oldname newname.
  15.  
  16. Cn also  supports the  ability of  Dos to  rename a file from one
  17. directory into another on the same drive.  Note that  the program
  18. isn't  finished  yet,  so  wildcard  masks  are  NOT supported at
  19. present  and  you  must   specify  the   full  pathname   of  the
  20. destination.
  21.  
  22. For example,  to move  the file cn.c from the \c directory to the
  23. \utils directory:
  24.  
  25.         cn \c\cn.c \utils\cn.c
  26.  
  27. This MOVES the file, as opposed to copying it.   The file  is not
  28. changed in  any way,  but simply appears in another directory and
  29. disappears from the original directory.  The only  real advantage
  30. of this  is that  it's faster  and you  don't have  to delete the
  31. original file if you don't want it there.
  32.  
  33. Needless to say, if  a  file  of  the  same  name  exists  in the
  34. destination directory, cn will abort with an error message.
  35.  
  36. This is truly the simplest program I've ever written!  All it does is 
  37. call the C library rename() function.  Oh well.  There's something to be 
  38. said for clean and simple code...
  39.  
  40.  
  41. -------------Changes as of 12/12/87 revision----------------
  42.  
  43. - Ported over for Turbo C compiler (original was Datalight.)  Code size
  44.   reduced from 4K to 1K.
  45.  
  46.