Copy "create-empty-src-dirs" JSON formatting help

Need a little help formatting some JSON.

I have run copy from the command line using the "--create-empty-src-dirs" and it does work successfully on my test folders.
The empty source folders are created.

I am trying to format a API call using JSON but looks like I don't know how to properly send the "--create-empty-src-dirs" flag.

Here is the current JSON in a PowerShell script I am using:
Write-Output( "Case 5: Download large number of files and folders to local system")
$headers=@{}
$headers.Add("user-agent", "vscode-restclient")
$headers.Add("content-type", "application/json")
$body='{ "srcFs" : "GDrive:TestFolder/5", "dstFs" : "G://RCloneResearch//DownloadTest", "arg" : [ "-create-empty-src-dirs" ] }'
Invoke-WebRequest -Uri 'http://127.0.0.1:5572/sync/copy' -Method POST -Headers $headers -ContentType 'application/json' -Body $body -UseBasicParsing

Here you are what has to be used:

If you wish to set config (the equivalent of the global flags) for the duration of an rc call only then pass in the _config parameter.

For example, if you wished to run a sync with the --checksum parameter, you would pass this parameter in your JSON blob.

"_config":{"CheckSum": true}

The same with other flags like --create-empty-src-dirs"

Thanks kapitainsky!
It wasn't the exact solution but it got me pointed in the right direction.
I found the following syntax works for this:
$body='{ "srcFs" : "GDrive:TestFolder/5", "dstFs" : "G:/Data/Work/Development/RCloneResearch/LocalTestDir/DownloadTest/dl", "createEmptySrcDirs" : "true" }'

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.