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

[GitHub] [incubator-opendal] MichaelScofield opened a new issue, #2759: Maybe remove the canonicalize in FsBackend?

MichaelScofield opened a new issue, #2759:
URL: https://github.com/apache/incubator-opendal/issues/2759

   At least under Windows. 
   
   In Windows, after a path is "canonicalize"d, it will be converted to the extended length path syntax. See [std::fs::canonicalize](https://doc.rust-lang.org/std/fs/fn.canonicalize.html). The syntax will prepend a special "`\\?\`" to a path. For example:
   
   ```rust
       let mut dir = std::env::current_dir().unwrap();
       println!("dir = {}", dir.display()); // prints "dir = D:\repo\rust-playground"
   
       let dir = dir.canonicalize().unwrap();
       println!("after canonicalize: {}", dir.display()); // prints "after canonicalize: \\?\D:\repo\rust-playground"
   ```
   
   `FsBuilder` canonicalize the root path when building the `FsBackend`:
   
   https://github.com/apache/incubator-opendal/blob/ead90ca8ff7bd319d65a0e12072f660b7a0d2d72/core/src/services/fs/backend.rs#L138
   
   It will cause the "list" in `FsBackend` failed easily. Users have to be very carefully constructing the input path argument to make the "list" work (because the "list" will `strip_prefix` the path with its root). Sometimes it's not an easy job.
   
   The document of the syntax can be found [here](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry). It was introduced to resolve the max path length limit (260 chars) in older Windows. However, in newer Windows, the limit can be removed completely (see the same doc). So maybe we can remove the canonicalize in FsBackend?


-- 
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


[GitHub] [incubator-opendal] Xuanwo commented on issue #2759: Maybe remove the canonicalize in FsBackend?

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

   Hi @MichaelScofield, I hope my comment helped fix your problems. Please let me know if there is anything that still does not meet your expectations.


-- 
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


[GitHub] [incubator-opendal] MichaelScofield closed issue #2759: Maybe remove the canonicalize in FsBackend?

Posted by "MichaelScofield (via GitHub)" <gi...@apache.org>.
MichaelScofield closed issue #2759: Maybe remove the canonicalize in FsBackend?
URL: https://github.com/apache/incubator-opendal/issues/2759


-- 
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