Skip to content

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
Contributor

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

3 participants