home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
datafiles
/
text
/
c_manual
/
system
/
amigados
/
example3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
2KB
|
52 lines
/***********************************************************/
/* */
/* Amiga C Encyclopedia (ACE) V3.0 Amiga C Club (ACC) */
/* ------------------------------- ------------------ */
/* */
/* Book: ACM System Amiga C Club */
/* Chapter: AmigaDOS Tulevagen 22 */
/* File: Example3.c 181 41 LIDINGO */
/* Author: Anders Bjerin SWEDEN */
/* Date: 92-05-02 */
/* Version: 1.10 */
/* */
/* Copyright 1992, Anders Bjerin - Amiga C Club (ACC) */
/* */
/* Registered members may use this program freely in their */
/* own commercial/noncommercial programs/articles. */
/* */
/***********************************************************/
/* This example demonstrates how to rename files and directories. It */
/* will rename the file Example 1 created (called "HighScore.dat") to */
/* "Numbers.dat". It will also rename the directory Example 2 created */
/* ("MyDirectory") to "NewDirectory". */
/* This file declares the type BOOL: */
#include <exec/types.h>
void main();
void main()
{
BOOL ok;
/* Rename the file: */
ok = Rename( "RAM:HighScore.dat", "RAM:Numbers.dat" );
/* Check if the file was successfully renamed: */
if( !ok )
printf( "The file could not be renamed!\n" );
/* Rename the directory: */
ok = Rename( "RAM:MyDirectory", "RAM:NewDirectory" );
/* Check if the directory was successfully renamed: */
if( !ok )
printf( "The directory could not be renamed!\n" );
}