Skip to content

Use os.access() to open attribute files in correct mode - #73

Merged
rhempel merged 1 commit into
ev3dev:masterfrom
ddemidov:issue-66
Nov 6, 2015
Merged

rhempel merged 1 commit into
ev3dev:masterfrom
ddemidov:issue-66

Conversation

@ddemidov

@ddemidov ddemidov commented Nov 6, 2015

Copy link
Copy Markdown
Member

Attribute files are opened in 'r', 'a', or 'a+' mode based on result of os.access() function call. 'a' and 'a+' are preferred to 'w' and 'w+' to not overwrite the files until actually asked by user.

This solves #66 for me in the sense that TouchSensor.commands now raises IOError: [Errno 95] Operation not supported. The rest of the bindings work as expected.

@ddemidov ddemidov changed the title Use of.access() to open attribute files in correct mode Use os.access() to open attribute files in correct mode Nov 6, 2015
rhempel added a commit that referenced this pull request Nov 6, 2015
Use os.access() to open attribute files in correct mode
@rhempel
rhempel merged commit bf05f94 into ev3dev:master Nov 6, 2015
@rhempel

rhempel commented Nov 6, 2015

Copy link
Copy Markdown
Member

Thks

@ddemidov
ddemidov deleted the issue-66 branch November 7, 2015 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants