You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "arianrhodsandlot (via GitHub)" <gi...@apache.org> on 2025/02/08 07:13:43 UTC

[I] bug: When using gdrive as the schema, `create_dir` is not working properly [opendal]

arianrhodsandlot opened a new issue, #5615:
URL: https://github.com/apache/opendal/issues/5615

   ### 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
   
   ```js
   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.
   
   <img width="495" alt="Image" src="https://github.com/user-attachments/assets/34ffbcc7-3667-4b27-b715-4a14c23f199f" />
   
   ### 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: When using gdrive as the schema, `create_dir` is not working properly [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #5615: bug: When using gdrive as the schema, `create_dir` is not working properly
URL: https://github.com/apache/opendal/issues/5615


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: When using gdrive as the schema, `create_dir` is not working properly [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #5615:
URL: https://github.com/apache/opendal/issues/5615#issuecomment-2644558115

   I'm guessing we need to trim the `/` after name:
   
   https://github.com/apache/opendal/blob/410f7edf633a6abe1feccec76f34724ec7a95606/core/src/services/gdrive/core.rs#L396-L405


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: When using gdrive as the schema, `create_dir` is not working properly [opendal]

Posted by "arianrhodsandlot (via GitHub)" <gi...@apache.org>.
arianrhodsandlot commented on issue #5615:
URL: https://github.com/apache/opendal/issues/5615#issuecomment-2646105293

   It seems `create_dir` isn't the only method not working as expected with gdrive, a majority of the methods related to gdrive seem to have some issues with the slashes as well. Examples:
   
   | code(Node.js) | result | note |
   |---|---|---|
   |`await op.write('/a/b/c.txt', 'hello!')`|<img width="354" alt="Image" src="https://github.com/user-attachments/assets/4a027cfc-a43e-4852-a6e3-47fef07f1196" />| the names of parents should be 'a' and 'b' rather than 'a/' and 'b/' |
   |`await op.list('/a/')`<br><br><img width="340" alt="Image" src="https://github.com/user-attachments/assets/d07dc95b-0d78-47c3-bbe6-ef5800db3037" />|`[]`|should be ['b2', 'b1', 'b']|
   |`await op.read('/a/b/c.txt')`<br><br><img width="333" alt="Image" src="https://github.com/user-attachments/assets/6922f134-259e-4c53-b7cf-2415c1e31d14" />|[Error: NotFound (permanent) at read, context: { service: gdrive, path: a/b/c.txt, range: 0- } => path not found: a/b/c.txt]|should return the content of the file|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org