TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: John Gardeniers
from: Peter Collis
date: 1996-04-06 14:17:24
subject: File name expansion

While listening to John Gardeniers Pete heard:File name expansion

G'day John

 JG> Next project: How to do a move without a copy if the
 JG> destination is the same drive as the source.  That would save quite a
 JG> bit of time with large files. Any thoughts?

Quite simple use the rename() function, see info below.

*************************************************************
Syntax:    int rename( char *oldname, char *newname );

Returns:   0 if successful, or a nonzero value if not.
           errno: EACCES, ENOENT, EXDEV

Info:

The rename function renames the file or directory specified by
 to the name given by . The old name must be the
path name of an existing file or directory. The new name must not
be the name of an existing file or directory.

The rename function can be used to move a file from one directory
to another by giving a different path name in the 
argument. However, files cannot be moved from one device to
another (for example, from drive A to drive B). Directories can
only be renamed, not moved.

Return Value

The rename function returns 0 if it is successful. On error, it
returns a nonzero value and sets errno to EACCES, ENOENT, or
EXDEV.
**************************************************************

   -=Pete=-


--- OMX/Blue Wave v2.12
* Origin: Gates of Hell (3:713/914.16)
SEEN-BY: 50/99 78/0 620/243 623/630 711/401 409 410 413 430 808 809 932 934
SEEN-BY: 712/508 515 713/111 317 601 611 615 618 700 826 888 914 714/906
SEEN-BY: 800/1 7877/2809
@PATH: 713/914 615 888 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.