it include two way using find is't super ugly but working good
- golang slice, in this way, better to do multi process using single file list
- golang channel, in this way, if you have huge mount of file list and single process
if you need get file list then channel is better. like after you install then run gfind ~
else if you need get file list and do a http request to precache something, which in my other repo, then use slice way is better.
package main
import (
"github.com/kiyor/gfind/lib"
)
func main() {
conf := gfind.InitFindConfByIni("config.ini")
fs := gfind.Find(conf)
gfind.Output(fs, false)
}
flag | desc |
---|---|
dir | location |
name | file name support regex |
ext | file extension |
rootdir | ignore prefix path |
maxdepth | like find |
ctime | like find |
cmin | like find |
mtime | like find |
mmin | like find |
atime | access time (day) |
amin | access time (minute) |
rt | use 'before' instead of 'after' for time related flag |
type | like find |
size | use [-/+]num[k/m/g/t] |
exec | try this 'ls {};du {}' |
[gfind]
dir = /home/user/folder
type = f
rootdir = /home/user
size = +20m
mtime = 1
only support linux