Save File statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Copies a file. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Save File old_filespec As new_filespec [ Append ] 

old_filespec is a string representing the name (and, optionally, the path) of an existing file; the file must not be open.

new_filespec is a string representing the name (and, optionally, the path) to which the file will be copied; the file must not be open.

Description

The Save File statement copies a file. The file must not already be open for input/output.

If you include the optional Append keyword, and if the file new_filespec already exists, the contents of the file old_filespec are appended to the end of the file new_filespec.

Do not use Save File to copy a file that is a component of an open table (for example, filename.tab, filename.map, etc.). To copy a table, use the Commit Table...As statement.

The Save File statement cannot copy a file to itself.

Example

Save File "settings.txt" As "settings.bak"

See Also:

Kill statement, Rename File statement