rename

rename --  renames a file.

Syntax

rename (filename, new_name)

		

Arguments

filename

The name of a file on disk.

new_name

The new name for the file.

Returns

t if the file could be renamed, otherwise nil.

Description

This function makes an operating system call rename a file on disk. The exact behavior of this function depends on the renaming facility for the operating system.

Example

    Gamma> rename("myfile.dat","x/myrenamedfile.dat");
    t
    Gamma> rename("x/myrenamedfile.dat","myfile.dat");
    t
    Gamma> 
    		

See the GTK: Preparing Plots section of the Log Functions chapter in the Cogent Tools Demo and Tutorials book for an example of this function used in context.

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.