*
* Usage: testrem -h give all info's
*
- * $Id: TestRen.c,v 1.1 2002/01/03 23:44:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
/* Help printing routine */
void usage(void);
* Variables definition
*/
int i;
+ char *buf,*copy;
/*
* Input section: decode command line parameters
* Use getopt function
*/
+ buf = malloc(100);
+
opterr = 0; /* don't want writing to stderr */
while ( (i = getopt(argc, argv, "h")) != -1) {
switch (i) {
usage();
}
if ( rename(argv[optind], argv[optind+1]) ) {
+ copy = strerror_r(errno, NULL, 0);
perror("cannot rename");
exit(1);
}