Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stat function to datasets #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add stat function to datasets #164

wants to merge 1 commit into from

Conversation

Matt-Haugh
Copy link

This PR adds a stat function to datasets which mimics some of the functionality of https://docs.python.org/3/library/os.html#os.stat.

Copy link
Member

@acroz acroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Matt-Haugh, thanks for the contribution!

My first thought is that os.stat gives information about a single file, whereas what you're trying to do here is more like ls -l - getting extra info about a list of files.

Would it make sense to instead integrate this into ls above? Looking at the ls (i.e. the command line tool) documentation, -l means 'long format', which we could borrow here with a signature like:

def ls(prefix="/", project_id=None, long=False, show_hidden=False, object_client=None):

What do you think?

Aside from resolving this question, this PR will also need to implement tests, but we can maybe discuss this once the above question is resolved.

@Matt-Haugh
Copy link
Author

Matt-Haugh commented May 1, 2020

Cheers @acroz, that sounds sensible. In fact part of the motivation for adding this was to add ls -l to the datasets branch that @liamcoatman has for faculty-cli. I'll get on reworking this over the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants