Подразделы Files

EVENTS

Событие изменения файла

[on] (file|dir[ectory]) creation[s] (at|for) [[the] (file[s]|dir[ector(y|ies)]|paths)] %strings%
[on] (file|dir[ectory]) modify[ication][s] (at|for) [[the] (file[s]|dir[ector(y|ies)]|paths)] %strings%
[on] (file|dir[ectory]) deletion[s] (at|for) [[the] (file[s]|dir[ector(y|ies)]|paths)] %strings%
[on] (file|dir[ectory]) overflow[s] (at|for) [[the] (file[s]|dir[ector(y|ies)]|paths)] %strings%
[on] every (file|dir[ectory]) change[s] (at|for) [[the] (file[s]|dir[ector(y|ies)]|paths)] %strings%

EXPRESSIONS

Файл

[the] (file[s]|dir[ector(y|ies)]) [path] %strings%
set {_file} to file "eula.txt"

Получить абсолютный путь к файлу

Абсолютный путь начинается с root

absolute path of %path%
%path%'s absolute path
set {_file} to absolute path of file "eula.txt"

Получить все файлы в директории

files in %path%
loop all files in dir "plugins/":
  broadcast "%loop-value%"

Получить текстовое содержание файла

Может быть изменено с использованием SET

content[s] of %path%
%path%'s content[s]
set {_file} to content of file "eula.txt"
replace all "false" with "true" in {_file}
set content of file "eula.txt" to {_file}

Имя файла или директории

Может быть изменено с использованием SET

name of %path%
%path%'s name
loop all files in dir "plugins/":
  broadcast name of file loop-value

Прочитать линии файла

Может быть изменено с использованием SET

[the] line %number% (from|of|in) %path%
[all] [the] lines (from|of|in) %path%
set line 1 of file "eula.txt" to "eula=true"

Получить родительскую директорию файла

Может быть изменено с использованием SET

parent of %path%
%path%'s parent
set {_file} to parent of file "eula.txt"

Размер файла в байтах

size of %path%
%path%'s size

Последняя дата доступа к файлу

last access time of %path%
%path%'s last access time

Последняя дата редактирования файла

last modified time of %path%
%path%'s last modified time

Дата создания файла

creation time of %path%
%path%'s creation time

Расширение файла

extension of %path%
%path%'s extension

Дисковая информация

total space of %path%
usable space of %path%

CONDITIONS

Проверка файла на его фактическое наличие

%path% (is|does)[(n't| not)] exist[s]
if file "eula.txt" is exists:
  broadcast "Yea, file eula.txt is exists"

Проверка что файл является директорией

%path% is[(n't| not)] dir[ectory]
if file "eula.txt" is not directory:
  broadcast "Yea, file eula.txt is not directory, it is regular file"

Проверка что файл является файлом

%path% is[(n't| not)] [a] file
if file "eula.txt" is file:
  broadcast "Yea, file eula.txt is regular file"

Проверка что файл пуст

%path% is[(n't| not)] empty

Проверка что файл выполняемый

%path% is[(n't| not)] executable

Проверка скрыт ли файл

%path% is[(n't| not)] hidden

Проверка читаем ли файл

%path% is[(n't| not)] readable

Проверка системный ли файл

%path% is[(n't| not)] [a] system file

Проверка что файл можно записать

%path% is[(n't| not)] writable

EFFECTS

Скопировать файл или директорию

copy %path% to %path%
copy file "plugins/Skcrew.jar" to file "./"

Создать простой файл

[(async/sync)] create %path% [with content %strings%]
create file "eula.txt" with content "eula=true"

Удалить файл или директорию

[(async/sync)] delete %path%
delete file "plugins/Skcrew.jar"

Переместить файл

[(async/sync)] move %paths% to %path%
move file "plugins" to file "disabled_plugins"

Переименовать файл

[(async/sync)] rename %path% to %string%
rename file "plugins/Skript/scripts/mycoolscript.sk" to "-mycoolscript.sk"

Распаковать zip архив

[(async/sync)] unzip %path% to %path%
unzip file "myarchive.zip" to file "./"

Запаковать в архив zip

[(async/sync)] zip %path% to %path%
zip file "world/" to file "backupworld.zip"

Скачать файл

[(async/sync)] download file from [url] %string% (and store it in|to) %path%
async download file from "https://crewpvp.xyz/file.rar" and store it in file "dwnldfiles/file.rar"