File: rename.c

package info (click to toggle)
cssc 1.0.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 3,620 kB
  • ctags: 1,424
  • sloc: cpp: 13,500; sh: 4,759; ansic: 2,971; perl: 342; makefile: 342; awk: 11
file content (15 lines) | stat: -rw-r--r-- 219 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#if HAVE_UNISTD_H
#include <unistdh>
#endif

#ifndef HAVE_RENAME

int
rename(const char *from, const char *to) {
	if (link(from, to) == -1 || unlink(from) == -1) {
		return -1;
	}
	return 0;
}

#endif /* HAVE_RENAME */