The filecatalog( function doesn't catalog packages

Issue #1228 resolved
Jim Rea repo owner created an issue

If the “insidepackages” option is off, this function should return the names of files that are packages.

The problem appears to be in lines 177-181 of FileCatalogFunction.m

NSNumber *isDirectory;

[fileURL getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];

if ([isDirectory boolValue]) {

continue; // don't include directories

}

This code should be checking to see if the folder is a package as lines 76-84 of FileExistsFunction.m do.

if ([fileURL directoryExistsAtURL]) {

// might be a package

NSError * xError;

NSNumber * isPackageURL;

[fileURL getResourceValue:&isPackageURL forKey:NSURLIsPackageKey error:&xError];

if ([isPackageURL boolValue]) {

itemExists = panTrue; // it IS a package

}

}

A consequence of this bug is that the copyfolder statement won’t copy packages.

Note: Possibly when fixing this, might want to add an option to include folder names in the output (even if they aren’t packages)?

https://forum.provue.com/t/does-copyfolder-statement-copy-the-contents-of-sub-folders/5025/3

Comments (2)

  1. Jim Rea reporter

    The filecatalog( function now includes packages in the output, and has new options INCLUDEFOLDERS and EXCLUDEFILES. Fixes issue #1228.

    This also fixes copying packages with the copyfolder statement.

    → <<cset ea4b007a0e48>>

  2. Log in to comment