Comments (8)
This is a file handle cache - the purpose of the extra bits in the device version is that it allows you to open a file with only the mode you ask for - maybe we can modify things so that if an attribute is r/w you get the right mode the first time :-) The reopen is only needed if you write to an attribute, and then read it later.
from ev3dev-lang-python.
We can also make the cache key to be file_name
/mode
. This will have two versions of the same file in cache, but would not require reopen.
from ev3dev-lang-python.
I'm not sure having one descriptor open for read and another for write is a good thing - I guess as long as the seek points are truly independent it will work - not sure though.
from ev3dev-lang-python.
It certainly works in C++ bindings. I agree it sounds a bit wasteful. And the trick with reopening on exception should work for all cases.
from ev3dev-lang-python.
Although it's not clear how to incorporate the trick into cache, since the try block should be around both cache access and file operation. May be we should think not about file handle cache, but file reader /writer?
from ev3dev-lang-python.
+1 File reader/writer (that takes advantage of a cache for file handles) :-)
from ev3dev-lang-python.
Something like this: https://github.com/ddemidov/ev3dev-lang-python-1/commit/00ed2429497828589da087ce0ba3cea2b6357348?
from ev3dev-lang-python.
Resolved by #31
from ev3dev-lang-python.
Related Issues (20)
- How to install other python package on EV3?
- Ev3dev odometry HOT 3
- Does MoveTank support two different Motor? HOT 1
- LEGO VISION COMMAND USB Camera with EV3 and ev3dev HOT 11
- Add typings? HOT 1
- Use with pybricks - micropython library HOT 1
- automaticaddison robot HOT 4
- Hello, I'm newbie with EV3DEV and I'm trying to make my absolute sensor working on my ev3. HOT 5
- Slow Import Speeds - Advice? HOT 3
- How do I create a program that runs a motor forever at a specific RPM? HOT 1
- Difficulty Connecting Old HiTechnic Infrared Seeker to ev3dev Brick HOT 2
- Project EV3 with pixy2, line detection using vscode how to get the line information from the camera? HOT 1
- How can I use a generic I2C sensor? HOT 12
- Unicode characters doesn't work HOT 1
- How do "on_..." button event handlers work?
- Best way to drive motors to absolute position
- Motor Ramping Assistance HOT 3
- Object tracking with NXT Cam V4 for LEGO Mindstorms HOT 8
- Trying to use Hitechnic FIRST Motor Controller for TETRIX HOT 3
- install opencv in ev3dev HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ev3dev-lang-python.