Expand description
Importing a folder from disk with its structure kept, after Eagle’s
uploadFolderToSidebar: the folder becomes an Eagle folder of the same
name, each subfolder a child folder, and every file is imported into
the folder that mirrors its parent directory.
walk reads the tree, plan turns it into folders to create and
files to import, and Library::create_folders adds the folders in one
metadata.json write. Importing the files is left to the caller, which
stages them on another thread.
Structs§
- NewFolder
- A folder to create for an imported tree.
- Plan
- What importing a
Treedoes to a library. - Stats
- The size of a walked tree.
- Tree
- A directory as walked from disk.
Enums§
- Verdict
- Whether a folder may be imported, after Eagle’s limits in
uploadFolderToSidebar.
Constants§
- MAX_
DEPTH - …or this many levels of folders or more.
- MAX_
FILES - Eagle refuses a folder with this many files or more…
- WARN_
FILES - From this many files Eagle asks before importing a folder.
Functions§
- is_
pixave_ library - Pixave libraries, which folder import skips as Eagle’s Import Folders does.
- is_
skipped - Whether a walk leaves
nameout: hidden files and OS junk. - plan
- Maps a walked tree to the folders to create and the file imports, with
the top folder placed in
parent(or at the top level).new_idgives each folder its id. - verdict
- Eagle’s limits: 15 levels or more, or 100,000 files or more, are refused; 2,000 files or more need a confirmation.
- walk
- Reads
dirand everything under it. Hidden files and junk are left out; packages count as files. Symbolic links to folders are not followed, so a link cycle can’t make the walk endless. Unreadable subfolders come back empty.