fs_extra icon indicating copy to clipboard operation
fs_extra copied to clipboard

options.copy_inside vs options.depth

Open smallB007 opened this issue 3 years ago • 2 comments

What is the meaning of those flags?

smallB007 avatar Mar 03 '21 07:03 smallB007

Tell me what point in the documentation is not clear so that I can improve :smiley:

webdesus avatar Mar 05 '21 09:03 webdesus

Hi and thanks for the reply. The documentation is not clear as to:

copy_inside: bool Sets the option true for recursively copying a directory with a new name or place it inside the destination.(same behaviors like cp -r in Unix) depth: u64 Sets levels reading. Set 0 for read all directory folder. By default 0.

Are those items dependent on each other? What will happen if I set depth to zero and copy_inside to false? The point I'm making is that there seems to be duplication of information. Example: If copy_inside set to true, then it would intuitively mean that recursive is on, but in this library's case we also need to have depth set to zero? Or from other angle, if depth is set to zero it means (I think) that there is no limit on recursive directory reading. If that's the case one of those options is surplus as we could convey that information just by using one of them, ideally depth: If zero, full recursion, anything more than zero specifies that only that depth of level inside dir should be read. And by doing so, we don't have to have copy_inside. With copy_inside we could also have: enum copy_inside { depth(isize)//zero means no recursion, -1 means full recursion, any other number specifies the level of recursion }

I hope that helps. In case you need more info, do let me know. Thanks

smallB007 avatar Mar 06 '21 12:03 smallB007