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

Feature Add support of os.chflags() on Linux platform #75494

Open
socketpair mannequin opened this issue Aug 31, 2017 · 5 comments
Open

Feature Add support of os.chflags() on Linux platform #75494

socketpair mannequin opened this issue Aug 31, 2017 · 5 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@socketpair
Copy link
Mannequin

socketpair mannequin commented Aug 31, 2017

BPO 31313
Nosy @pitrou, @larryhastings, @socketpair
Files
  • chiflag.c
  • 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 = None
    created_at = <Date 2017-08-31.09:55:01.045>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Feature Add support of os.chflags() on Linux platform'
    updated_at = <Date 2017-09-01.09:27:54.508>
    user = 'https://github.com/socketpair'

    bugs.python.org fields:

    activity = <Date 2017-09-01.09:27:54.508>
    actor = 'pitrou'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2017-08-31.09:55:01.045>
    creator = 'socketpair'
    dependencies = []
    files = ['47115']
    hgrepos = []
    issue_num = 31313
    keywords = []
    message_count = 5.0
    messages = ['301043', '301046', '301089', '301091', '301092']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'larry', 'neologix', 'socketpair']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue31313'
    versions = ['Python 3.7']

    @socketpair
    Copy link
    Mannequin Author

    socketpair mannequin commented Aug 31, 2017

    Yes, chflags() is not supported by linux directly. But actually, Linux supports chflags functionality:

    https://stackoverflow.com/questions/34176464/why-os-chflags-doesnt-work-under-linux

    through

    ioctl (fd, EXT2_IOC_SETFLAGS, <BITMASK_OF_FLAGS>)

    @socketpair socketpair mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 31, 2017
    @pitrou
    Copy link
    Member

    pitrou commented Aug 31, 2017

    Judging by the ioctl name, this is ext2/ext3/ext4 specific?

    @socketpair
    Copy link
    Mannequin Author

    socketpair mannequin commented Sep 1, 2017

    Well, it seems, you are right.

    But there are another ioctls (maybe they are the same, I haven't checked):

    FS_IOC_SETFLAGS
    FS_IOC_GETFLAGS

    http://man7.org/tlpi/code/online/book/files/chiflag.c.html (also attached)

    @pitrou
    Copy link
    Member

    pitrou commented Sep 1, 2017

    On Ubuntu 16.04 I get the following values:
    EXT2_IOC_SETFLAGS = 0x40086602, FS_IOC_GETFLAGS = 0x80086601

    @pitrou
    Copy link
    Member

    pitrou commented Sep 1, 2017

    Uh, of course, we care about SETFLAGS here. Which gives:
    EXT2_IOC_SETFLAGS = 0x40086602, FS_IOC_SETFLAGS = 0x40086602

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant