question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A few documentation questions about path and seperator

See original GitHub issue

Hi all, I have a few questions about the current implementations:

  1. I noticed there is a sep attribute in AbstractFileSystem. But all built-in implementations use /, even for LocalFileSystem on windows, right?
  2. Should paths passed into fs.xxx have protocols? For example, I saw some implementations calls _strip_protocol for paths, and some don’t (for example, other methods in ArrowFsWrapper calls it, but not for ls see arrow.py and #1086). Should they be consistent? If they should, we need to fix current implementations and document this change somewhere.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
martindurantcommented, Nov 5, 2022

Correct, sep is always “/”. Originally, we had os.sep for the local filesystem, but found this unworkable, so the attribute is just a hangover and not useful. I don’t think it’s referenced anywhere.

Seconds, filesystems should normally call _strip_protocol and allow full URLs passed in. You are welcome to make a PR to HDFS to make sure this works there too.

0reactions
martindurantcommented, Nov 7, 2022

should we also state in the document that methods like ls or touch in fs should also accept url

Yes, and probably this belongs in AbstractFileSystem’s docstrings

Read more comments on GitHub >

github_iconTop Results From Across the Web

File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
Read more >
When should I use File.separator and when File.pathSeparator?
File.pathSeparator is used to separate individual file paths in a list of file paths. Consider on windows, the PATH environment variable. You use...
Read more >
Paths explained: Absolute, relative, UNC, and URL—Help
Relative paths are relative to a current directory, which is the location of the saved document or toolbox. UNC paths. UNC stands for...
Read more >
Chapter 8 – Reading and Writing Files
On Windows, paths are written using backslashes (\) as the separator between folder names. OS X and Linux, however, use the forward slash...
Read more >
Change path separator in currfile - TeX - LaTeX Stack Exchange
This might be done, e.g., via writing directives for defining a macro to .aux-file and checking whether the macro in question is defined:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found