fileOpen
Открывает файл
fileOpen(filePath [, mode [, charset] [, seekable]]) → returns any
Описание аргументов
filePath string Обязательный
Абсолютный путь к файлу на диске или в памяти сервера
mode string
По умолчанию: read
read
Тип доступа к потоку файла
Значения:
readreadBinarywriteappend
charset string
Кодировка символов, определяемая маркером порядка байтов файла, если он есть; в противном случае используется набор символов файлов по умолчанию для JVM
Значения:
utf-8iso-8859-1windows-1252us-asciishift_jisiso-2022-jpeuc-jpeuc-krbig5euc-cnutf-16
seekable boolean
По умолчанию: false
false
Можно ли использовать файл с функцией
fileSeek Примеры Пример кода, вызывающего функцию fileOpen
// Open File
var fileObject = fileOpen("/path/to/file.txt");
// Perform Actions
try
{
// Read Line
writeOutput(fileReadLine(fileObject));
}
// Error Handling
catch(any ex)
{
// Report Exception
writeDump(ex);
}
// Always Close
finally
{
// Close File
fileClose(fileObject);
}
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/fileopen