close file

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
close file <filePath>
Summary

Closes a file that was opened with the open file command.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
filePath

The name and location of the file you want to close. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder.

Example
close file "/Desktop/Temp"
close file line 1 of the openFiles
open file (specialFolderPath("desktop") & "/text.txt")
write "This is a test" \
      to file (specialFolderPath("desktop") & "/text.txt" )
close file (specialFolderPath("desktop") & "/text.txt")
Values
NameTypeDescription
The result

If you try to close a file that is not already open, the result function is set to "file is not open".

RelatedKeyword: file, modem:
Command: write to file, close driver, open file, close, seek, read from file, delete file
Function: openFiles, sysError
Glossary: command
Securitydisk
Description

Use the close file command to release a file after reading from it or writing to it. (A file that is open for writing can't be used by any other application until you've closed the file.)

Any files you have opened are closed automatically when you quit the application. printer:(keyword), COMn: (keyword), LPT1: (keyword), serialControlString (property)

Tagsfile system