-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
File.txt
94 lines (75 loc) · 3.46 KB
/
File.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
*vital/Async/File.txt* asynchronous filesystem utilities library.
Author : Alisue <lambdalisue@hashnote.net>
==============================================================================
CONTENTS *Vital.Async.File-contents*
INTRODUCTION |Vital.Async.File-introduction|
INTERFACE |Vital.Async.File-interface|
Functions |Vital.Async.File-functions|
==============================================================================
INTRODUCTION *Vital.Async.File-introduction*
*Vital.Async.File* is an asynchronous filesystem utilities library.
It is asynchronous version of |Vital.System.File| with some additional
functions.
==============================================================================
INTERFACE *Vital.Async.File-interface*
------------------------------------------------------------------------------
FUNCTIONS *Vital.Async.File-functions*
is_open_supported() *Vital.Async.File.is_open_supported()*
Returns TRUE if "open()" is supported in a current platform.
is_move_supported() *Vital.Async.File.is_move_supported()*
Returns TRUE if "move()" is supported in a current platform.
is_copy_supported() *Vital.Async.File.is_copy_supported()*
Returns TRUE if "copy()" is supported in a current platform.
is_copy_dir_supported() *Vital.Async.File.is_copy_dir_supported()*
Returns TRUE if "copy_dir()" is supported in a current platform.
is_trash_supported() *Vital.Async.File.is_trash_supported()*
Returns TRUE if "trash()" is supported in a current platform.
open({expr}[, {options}]) *Vital.Async.File.open()*
Returns a promise to opens an {expr} by a system command.
>
call s:F.open("/tmp/file")
\.then({ -> execute('echo "opened"', '') })
<
The {options} is passed to |Vital.Async.Promise.Process.start()|.
So to cancel the operation, assign |Vital.Async.CancellationToken|
to {options.token}.
move({src}, {dst}[, {options}]) *Vital.Async.File.move()*
Return a promise to move a {src} to {dst}.
>
call s:F.move("/tmp/old", "/tmp/new")
\.then({ -> execute('echo "moved"', '') })
<
The {options} is passed to |Vital.Async.Promise.Process.start()|.
So to cancel the operation, assign |Vital.Async.CancellationToken|
to {options.token}.
copy({src}, {dst}[, {options}]) *Vital.Async.File.copy()*
Return a promise to copy a {src} file to {dst}.
Use |Vital.Async.File.copy_dir()| to copy a directory.
>
call s:F.copy("/tmp/file.old", "/tmp/file.new")
\.then({ -> execute('echo "copied"', '') })
<
The {options} is passed to |Vital.Async.Promise.Process.start()|.
So to cancel the operation, assign |Vital.Async.CancellationToken|
to {options.token}.
copy_dir({src}, {dst}[, {options}]) *Vital.Async.File.copy_dir()*
Return a promise to copy a {src} directory to {dst}.
Use |Vital.Async.File.copy()| to copy a file.
>
call s:F.copy_dir("/tmp/old", "/tmp/new")
\.then({ -> execute('echo "copied"', '') })
<
The {options} is passed to |Vital.Async.Promise.Process.start()|.
So to cancel the operation, assign |Vital.Async.CancellationToken|
to {options.token}.
trash({path}[, {options}]) *Vital.Async.File.trash()*
Return a promise to move {path} into a system trash.
>
call s:F.trash("/tmp/file")
\.then({ -> execute('echo "trashed"', '') })
<
The {options} is passed to |Vital.Async.Promise.Process.start()|.
So to cancel the operation, assign |Vital.Async.CancellationToken|
to {options.token}.
==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl