Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

Question: When using GraphClient, is it possible to create a nested folder, even if one or more of the intermediate folders don't exist?

Open dekiesel opened this issue 1 year ago • 1 comments

Let's say I have a DriveItem and a path, like a/b/c.

I want to get folder c as a DriveItem. If c and/or the intermediate folders a/b don't exist I want to create them.

Is there an easy way to do this with GraphClient? I found this for Web: Web.ensure_folder_path(path), as explained here, but this seems to be specific to Web.

Any ideas? Or do I need to iterate over all intermediate folders (from root) and create them if they don't exist?

Thanks in advance!

dekiesel avatar May 17 '24 13:05 dekiesel

Greetings,

Or do I need to iterate over all intermediate folders (from root) and create them if they don't exist?

appears to be the only option, let's keep this issue open until support for this method is introduced in the library.

Thank you for the good idea!

vgrem avatar May 26 '24 12:05 vgrem