+ if (*doSeen && strings.HasSuffix(info.Name(), nncp.SeenSuffix)) ||
+ (*doNoCK && strings.HasSuffix(info.Name(), nncp.NoCKSuffix)) ||
+ (*doHdr && strings.HasSuffix(info.Name(), nncp.HdrSuffix)) ||
+ (*doPart && strings.HasSuffix(info.Name(), nncp.PartSuffix)) {
+ ctx.LogI("rm", nncp.LEs{{K: "File", V: path}}, logMsg)
+ if *dryRun {
+ return nil
+ }
+ return os.Remove(path)
+ }
+ if *pktRaw != "" && filepath.Base(info.Name()) == *pktRaw {
+ ctx.LogI("rm", nncp.LEs{{K: "File", V: path}}, logMsg)
+ if *dryRun {
+ return nil
+ }
+ return os.Remove(path)
+ }
+ if !*doSeen && !*doNoCK && !*doHdr && !*doPart &&
+ (*doRx || *doTx) &&
+ ((*doRx && xx == nncp.TRx) || (*doTx && xx == nncp.TTx)) {
+ ctx.LogI("rm", nncp.LEs{{K: "File", V: path}}, logMsg)
+ if *dryRun {
+ return nil
+ }
+ return os.Remove(path)
+ }
+ return nil
+ })
+ }
+ if *pktRaw != "" || *doRx || *doSeen || *doNoCK || *doHdr || *doPart {
+ if err = remove(nncp.TRx); err != nil {
+ log.Fatalln("Can not remove:", err)
+ }
+ }
+ if *pktRaw != "" || *doTx || *doHdr {
+ if err = remove(nncp.TTx); err != nil {
+ log.Fatalln("Can not remove:", err)
+ }
+ }
+ if *doArea {
+ if err = filepath.Walk(
+ filepath.Join(ctx.Spool, node.Id.String(), nncp.AreaDir),
+ func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ if os.IsNotExist(err) {
+ return nil
+ }
+ return err
+ }
+ if info.IsDir() {