-
Notifications
You must be signed in to change notification settings - Fork 64
/
File.txt
89 lines (72 loc) · 2.78 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
*vital/System/File.txt* filesystem utilities library.
Maintainer: Shougo <[email protected]>
tyru <[email protected]>
==============================================================================
CONTENTS *Vital.System.File-contents*
INTRODUCTION |Vital.System.File-introduction|
INTERFACE |Vital.System.File-interface|
Functions |Vital.System.File-functions|
==============================================================================
INTRODUCTION *Vital.System.File-introduction*
*Vital.System.File* is Filesystem Utilities Library.
It provides some functions for file system.
>
let s:V = vital#{plugin-name}#new()
let s:F = s:V.import("System.File")
<
==============================================================================
INTERFACE *Vital.System.File-interface*
------------------------------------------------------------------------------
FUNCTIONS *Vital.System.File-functions*
open({filename}) *Vital.System.File.open()*
Opens a file specified as {filename}. {filename} is a file or a
directory.
>
call s:F.open("/tmp/file")
<
move({src}, {dest}) *Vital.System.File.move()*
Renames a file {src} to {dest}. Returns non-zero if successful,
otherwise 0.
>
call s:F.move("/tmp/old", "/tmp/new")
<
copy({src}, {dest}) *Vital.System.File.copy()*
Copies a file {src} to {dest}. Returns non-zero if successful,
otherwise 0.
>
call s:F.copy("/tmp/old", "/tmp/new")
<
copy_dir({src}, {dest}) *Vital.System.File.copy_dir()*
This function invokes |Vital.System.File.copy_dir_exe()|
if your environment has a command to copy a directory.
Otherwise, this function invokes |Vital.System.File.copy_dir_vim()|.
Returns non-zero on success.
Returns zero on failure.
copy_dir_exe({src}, {dest}) *Vital.System.File.copy_dir_exe()*
Copy a {src} directory to {dest}.
This function only works if your environment has a command
to copy a directory. See the followings for the required command.
Unix Windows ~
cp robocopy
Returns non-zero on success.
Returns zero on failure.
copy_dir_vim({src}, {dest}) *Vital.System.File.copy_dir_vim()*
This is pure Vim script implementation of
|Vital.System.File.copy_dir_exe()|.
Returns non-zero on success.
Returns zero on failure.
*Vital.System.File.mkdir_nothrow()*
mkdir_nothrow({name} [, {path} [, {prot}]])
Creates a directory {name} without throwing any exception. The
arguments are used like with |mkdir()|. Returns a non-zero Number
if successful, otherwise 0.
>
echo s:F.mkdir_nothrow("/tmp/exists_file")
" 0
<
rmdir({path} [, {flags}]) *Vital.System.File.rmdir()*
Removes a directory {path}.
If {flags} contains "r", this removes the directory and its contents
recursively.
==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl