Does copyfolder statement copy the contents of sub-folders?

The Help file says of the copyfolder statement:

“This statement copies an entire folder full of files (and subfolders, if any).”

… which is a tad ambigiuous. It certainly copies the sub-folders but it doesn’t copy the files in those sub-folders. Should it?

An obvious work-around is to copy the contents of each sub-folder separately which could get tedious.

It should and it does. I just did a test to double check, and it worked perfectly.

(Of course I tested just now with 10.2, which I assume you are using also. I think this statement had problems in earlier version of Panorama X.)

For me, it copies all files other than those with a .pandb extension. I used this statement:

copyfolder dbfolder() + "Master folder", dbfolder() + "Master folder backup"

with this Master folder content:

Screen Shot 2021-12-16 at 11.27.50 am

and got this copy:

Screen Shot 2021-12-16 at 11.28.00 am

I have ‘show all extensions’ set on. Am I doing something wrong?

Curious. Where the other files open at the time?

The problem seems to be with the filecatalog( function in the code of the copyfolder custom statement. It apparently doesn’t catalog packages. I tried putting an rtfd in a folder that had some Panorama X databases, and some image files. Only the images were catalogued by filecatalog(. rtfd documents are also packages.

The problem seems to be with the filecatalog( function

Bingo! We have a winner. Rather amazing that neither myself nor anyone else has noticed this in six years.

Oh wait, it actually WAS noticed six years ago. I’ve just now marked this old bug report as a duplicate since I put a lot more information into the new bug report.

While you’re waiting for issue 1226 to be fixed, you can copy folders with the ditto shell command, using the shellscript statement.