Comments (7)
Maybe this is an XY problem and the real solution would be to allow me to modify metadata using inotify. Doesn't really matter in the end
from aspen.
IsforceLoadFileentryAtPath
not returning you the handle?
Also since you say you are trying to get a handle after the rename, could it be that you are querying the old file by mistake?
Also note that if inotify is used properly, the FileEntry object reference remains the same even after it is renamed, again this is assuming inotify was provided with appropriate info.
from aspen.
Is
forceLoadFileentryAtPath
not returning you the handle?
I... did not know that function existed.
Also since you say you are trying to get a handle after the rename, could it be that you are querying the old file by mistake?
Considering I couldn't find out how to run any query, no.
Also note that if inotify is used properly, the FileEntry object reference remains the same even after it is renamed, again this is assuming inotify was provided with appropriate info.
Exactly, this is why it's not being populated with the correct metadata.
I'll try out forceLoadFileentryAtPath
, but I'd prefer not to force a load if aspen is not yet interested (i.e. parents haven't been expanded and such).
from aspen.
Turns out none of that was needed.
The solution I settled on was to check if, during a rename, the new path is a different "kind" of file than the old path (as in the metadata needs changing). If so, just delete the old path and use an Added event to create the new one.
The code looks something like this:
from aspen.
Now I need this for a different reason - chokidar
likes to fire 8 billion add
events immediately upon startup, and there is no way to turn that off. Aspen reads the files, but then chokidar
fires its 8 billion add
events for those entries that already exist - long story short, there end up being multiple instances of the same path in the tree view.
Alternatively aspen-core
could like not add duplicate entries since this apparently is such a common behavior that not a single chokidar issue mentions it.
from aspen.
Did you try the ignoreInitial
option of chokidar?
from aspen.
Did you try the
ignoreInitial
option of chokidar?
I did not know that existed, it has such a non-obvious name. I literally did search all the members of WatchOptions too. Thanks
from aspen.
Related Issues (16)
- Covert this repo to a monorepo HOT 4
- Expand all initially? HOT 4
- Large data hangs the page and it crashes HOT 3
- is alive? HOT 2
- Question - load tree HOT 3
- ensureVisible inside useEffect and "two children with the same key" HOT 9
- Supporting windowing back to server-side HOT 3
- Improve NPM searchability HOT 2
- Find another filesystem watcher to recommend
- Uncaught Error: orphaned/detached FileEntries don't have path (except Root) HOT 6
- Allow getting current scroll HOT 8
- Ability to set scroll offset without using the DOM directly
- PromptHandle.ProxiedInput only supports className, style, and id props HOT 2
- Aspen 2 release discussion HOT 14
- Looking for project maintainers/contributors HOT 6
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 aspen.