Skip to content

Why opendal choose to trim the leading /s. #1039

Answered by Xuanwo
RinChanNOWWW asked this question in Q&A
Discussion options

You must be logged in to vote

I'm wondering why opendal choose to normalize the path by tirmming the leading '/'. (What's the purpose?)

The most important thing is security. OpenDAL maintains an idea about root_dir which means all operations input and output will be scoped under root_dir. After settings root_dir to /path/to/dir, OpenDAL ensures that data outside of /path/to/other_dir will not be accessed. (soft link is not supported so far).

And it's also important to write correct and painless code. Users don't need to consider the differences between abs_path and rel_path.

If I want to access a absolute path on my own local filesystem (for example: '/home/rinchannow/xxx.parquet'), it means I have to set the opera…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RinChanNOWWW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1038 on December 03, 2022 10:42.