file

Typekeyword
DictionaryLCS
LibraryLiveCode Script
Syntax
file
Summary

Used as a URL type with such commands as put and get to designate a local file.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
put the htmlText of field 1 into URL "file:/Drive/Folder/File"
answer URL "file:myPrefs.txt"
put URL "file:C:/abc.def" into savedInfo
put "Test" into word 3 of URL "file:/Hard Drive/Applications/Test"
RelatedKeyword: binfile, URL, file, http, resfile
Property: fileType, defaultFolder
Command: close file, revCopyFile, put, get
Glossary: binary file, text file, local file, absolute file path, URL scheme, container, keyword, relative file path, end-of-line marker, command
Description

Use the file keyword to work with text files.

The file scheme indicates a text file which is located on the user's system. The file is specified by either a full path starting with "/", or a relative path starting from the defaultFolder.

A URL container can be used anywhere another container type is used.

Different operating systems use different characters to mark the end of a line. Mac OS and OS X use a return character (ASCII 13), Unix systems use a linefeed character (ASCII 10), and Windows systems use a return followed by a linefeed. When you use a file URL as a container, LiveCode automatically uses the current system's standard end-of-line marker and LiveCode's linefeed character.

Tip: To put data into, or get data from, a binary file, use the binfile keyword instead.

For technical information about URLs and the file URL scheme, see RFC 1630 at http://www.ietf.org/rfc/rfc1630.txt.

Tagsfile system