Skip to content

bug: When using gdrive as the schema, create_dir is not working properly #5615

@arianrhodsandlot

Description

@arianrhodsandlot

Describe the bug

When calling create_dir with gdrive as the schema, the directory is not created with an expected name.
I was using the latest Node.js bindings.

Steps to Reproduce

import { Operator } from 'opendal'

const op = new Operator('gdrive', { access_token: '****' })

// a directory with name 'a/' created since Google Drive treats '/' as a valid character for file name
await op.createDir('a/')

// an error occurred:
// Error: NotADirectory (permanent) at create_dir, context: { service: gdrive, path: a } => the path trying to create should end with `/`
await op.createDir('a')

There seems to be no way to create a directory whose name does not contain a trailing slash.

Image

Expected Behavior

While calling await op.createDir('a/'), a directory named 'a' rather than 'a/' should be created

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions