MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / folderExcludeSuffixes

Function folderExcludeSuffixes

pkg/unpackerr/folder.go:355–371  ·  view source on GitHub ↗

folderExcludeSuffixes returns archive suffixes to ignore when scanning for items to extract. For watched archive files with disable_recursion enabled, exclude all archive suffixes so extracted nested archives are not picked up by follow-up scans in the extraction library.

(path string, cfg *FolderConfig)

Source from the content-addressed store, hash-verified

353// For watched archive files with disable_recursion enabled, exclude all archive suffixes so
354// extracted nested archives are not picked up by follow-up scans in the extraction library.
355func folderExcludeSuffixes(path string, cfg *FolderConfig) []string {
356 exclude := []string{}
357 if !cfg.ExtractISOs {
358 exclude = append(exclude, ".iso")
359 }
360
361 if !cfg.DisableRecursion {
362 return exclude
363 }
364
365 stat, err := os.Stat(path)
366 if err != nil || stat.IsDir() || !xtractr.IsArchiveFile(path) {
367 return exclude
368 }
369
370 return append(exclude, xtractr.SupportedExtensions()...)
371}
372
373func getFileList(path string) []os.FileInfo {
374 dir, err := os.Open(path)

Calls

no outgoing calls