1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

tce add nfs.append

This commit is contained in:
shaoying 2018-06-30 10:30:48 +08:00
parent c9b654262d
commit ea2d45692d
2 changed files with 7 additions and 1 deletions

View File

@ -927,6 +927,12 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
fmt.Fprint(f, strings.Join(arg[1:], ""))
} // }}}
}},
"append": &ctx.Command{Name: "append file string...", Help: "写入文件, string: 写入内容, pos: 写入位置", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
if f, e := os.OpenFile(arg[0], os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666); m.Assert(e) { // {{{
defer f.Close()
fmt.Fprint(f, strings.Join(arg[1:], ""))
} // }}}
}},
"genqr": &ctx.Command{Name: "genqr [size] file string...", Help: "写入文件, string: 写入内容, pos: 写入位置", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
size := 256 // {{{
if len(arg) > 2 {

View File

@ -26,7 +26,7 @@
{{range $key := index $meta "append"}}
{{if eq $key "name"}}
<td class="{{$key}}">
<a href="/upload?dir={{index $meta "path" $i}}"><code>{{index $meta $key $i}}</code></a>
<a download="{{index $meta $key $i}}" href="/upload?dir={{index $meta "path" $i}}"><code>{{index $meta $key $i}}</code></a>
</td>
{{else if eq $key "path"}}
{{else}}