file: Prepare folder copying support.
fileProvider: finish adding folder copying support.
This code is more complex than it had to be, because the OS's Bfile functions are buggy (see comments), so one must use workarounds that use more memory, making the introduction of limits necessary. Right now, each folder (and folder-inside-folder) that is copied can only have 50 items (files or folders).