aboutsummaryrefslogtreecommitdiff
path: root/sys/libc/crename.c
blob: 5f5b6668618d71186224883696adaedc8a971b15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
*/

#define import_spp
#define	import_libc
#define	import_xnames
#include <iraf.h>


/* C_RENAME -- FIO rename file.
*/
int
c_rename (
  char	*old_fname,		/* current name of file		*/
  char	*new_fname		/* new file name		*/
)
{
	XCHAR	spp_new_fname[SZ_FNAME];
	int	maxch = SZ_FNAME;

	c_strupk (new_fname, spp_new_fname, maxch);
	iferr (RENAME (c_sppstr(old_fname), spp_new_fname))
	    return (ERR);
	else
	    return (OK);
}