49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
// File.wdl
|
|
use core.accessibility_modifier;
|
|
use core.identifier;
|
|
use core.type_system;
|
|
|
|
module File {
|
|
syntax {
|
|
type_system.extend({
|
|
name: "File",
|
|
category: "system_resource",
|
|
immutable_operations: true
|
|
});
|
|
}
|
|
|
|
// File permissions enum
|
|
type FilePermission {
|
|
String read = "r";
|
|
String write = "w";
|
|
String execute = "x";
|
|
}
|
|
|
|
// Core File type
|
|
type File {
|
|
String path;
|
|
Integer size;
|
|
|
|
+fn on_create(String filepath) -> [File];
|
|
|
|
+fn read() -> [String];
|
|
+fn write(String content) -> [Boolean];
|
|
+fn append(String content) -> [Boolean];
|
|
|
|
+fn exists() -> [Boolean];
|
|
+fn delete() -> [Boolean];
|
|
+fn move(String destination) -> [Boolean];
|
|
+fn copy(String destination) -> [Boolean];
|
|
|
|
+fn get_permissions() -> [FilePermission<>];
|
|
+fn set_permissions(FilePermission<> permissions) -> [Boolean];
|
|
}
|
|
|
|
// File system operations
|
|
+fn create(String path) -> [File];
|
|
+fn exists(String path) -> [Boolean];
|
|
+fn delete(String path) -> [Boolean];
|
|
+fn move(String source, String destination) -> [Boolean];
|
|
+fn copy(String source, String destination) -> [Boolean];
|
|
}
|