FileDocument - open another file in the same directory as selected file

I'm working on a macOS app where my file format can include other files (think #include in C/C++). When opening a file with SwiftUI's document-based APIs (i.e., FileDocument), is there a way to get access to those other files? Alternatively, is there a way I could "open" the file's directory, similar to how Xcode opens the directory that a .xcodeproj is located?

I don't mind falling back to older Cocoa APIs if this is too obscure for the shiny new stuff :)

Use the FileWrapper class to store your document as a package of files and folders that appears as a single file in the Finder. The following article provides an introduction to working with file wrappers in a SwiftUI app:

https://www.swiftdevjournal.com/using-file-wrappers-in-a-swiftui-app/

FileDocument - open another file in the same directory as selected file
 
 
Q