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)
| 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. |
| 355 | func 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 | |
| 373 | func getFileList(path string) []os.FileInfo { |
| 374 | dir, err := os.Open(path) |
no outgoing calls