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 posix.fdlistdir #54964

Closed
rosslagerwall mannequin opened this issue Dec 22, 2010 · 5 comments
Closed

Add posix.fdlistdir #54964

rosslagerwall mannequin opened this issue Dec 22, 2010 · 5 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@rosslagerwall
Copy link
Mannequin

rosslagerwall mannequin commented Dec 22, 2010

BPO 10755
Nosy @loewis, @pitrou, @tiran, @benjaminp, @durban, @anacrolix
Files
  • i_fdlistdir.patch: Patch to add posix.fdlistdir
  • i10755.patch: Updated patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-02-25.23:41:43.489>
    created_at = <Date 2010-12-22.07:26:12.190>
    labels = ['extension-modules', 'type-feature']
    title = 'Add posix.fdlistdir'
    updated_at = <Date 2011-02-25.23:41:43.487>
    user = 'https://bugs.python.org/rosslagerwall'

    bugs.python.org fields:

    activity = <Date 2011-02-25.23:41:43.487>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-02-25.23:41:43.489>
    closer = 'pitrou'
    components = ['Extension Modules']
    creation = <Date 2010-12-22.07:26:12.190>
    creator = 'rosslagerwall'
    dependencies = []
    files = ['20136', '20145']
    hgrepos = []
    issue_num = 10755
    keywords = ['patch']
    message_count = 5.0
    messages = ['124489', '124491', '124493', '124538', '129471']
    nosy_count = 8.0
    nosy_names = ['loewis', 'pitrou', 'christian.heimes', 'benjamin.peterson', 'daniel.urban', 'anacrolix', 'Chris.Gerhard', 'rosslagerwall']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue10755'
    versions = ['Python 3.3']

    @rosslagerwall
    Copy link
    Mannequin Author

    rosslagerwall mannequin commented Dec 22, 2010

    Along with bpo-4761, the *at wrappers, it would be nice to have a patch adding the use of fdopendir.

    This patch adds a function fdlistdir, a unittest and documentation.

    @rosslagerwall rosslagerwall mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Dec 22, 2010
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 22, 2010

    What's the use case for this function?

    @rosslagerwall
    Copy link
    Mannequin Author

    rosslagerwall mannequin commented Dec 22, 2010

    When maintaining an fd to implement a per thread current directory, you can use it to get a list of files in the directory.

    For security reasons, instead of a named path, you can keep an fd to a directory so that if the path is changed externally while performing an operation, the open fd still points to the original directory. This function then allows you to list the contents of that fd. I think this is needed for bpo-4489.

    @rosslagerwall
    Copy link
    Mannequin Author

    rosslagerwall mannequin commented Dec 23, 2010

    Hi,

    Attached is a slightly updated patch that improves doc and changes fdlistdir to always return strings, not bytes.

    @pitrou
    Copy link
    Member

    pitrou commented Feb 25, 2011

    Committed in r88625. Thank you!

    @pitrou pitrou closed this as completed Feb 25, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant