Comments (4)
where do you get the filePath
from?
from objc.
Oh that's just a local string to a full, absolute path.
For this test, I used:
/Users/ejal/dev/filur/sandbox/test target/.gitignore
from objc.
- i found the bug and fixed it (the new version is already pushed to npm, not sure how long it takes to propagate but you can fix it for the time being by using this workaround):
// instead of objc.ns([nsUrl]);
const nsArray = NSMutableArray.array();
nsArray.addObject_(nsUrl);
- you probably should replace the
-[NSWorkspace recycleURLs:completionHandler:]
call with-[NSFileManager trashItemAtURL:resultingItemURL:error:]
. The first one is asynchronous and requires a properly set up run loop (which you'd need to do manually and which probably wouldn't be trivial). TheNSFileManager
one is synchronous, which means that you can simply call it w/out having to implement anything else to make it work:
const trashUrl = objc.allocRef();
const error = objc.allocRef();
const success = NSFileManager.defaultManager().trashItemAtURL_resultingItemURL_error_(nsUrl, trashUrl, error);
from objc.
Amazing. Thanks for the quick turnaround.
I verified that both the NSMutableArray
approach and the updated 0.16 version work.
Thanks for the hint about NSFileManager
too. Seems like it's the more modern approach.
👍
from objc.
Related Issues (20)
- Ref conversions HOT 2
- Getting data out of a CVPixelBuffer HOT 18
- please update to node >10 version HOT 1
- Symbol not found with Node 10.11.0 and Electron 4.0 HOT 1
- Delegating HOT 5
- how convert nativeWindowHandle to NSView HOT 8
- how can i import custom framework?
- build fails on npm install --save objc HOT 3
- Support for Node 14.x ??? HOT 2
- How to get NSView or NSWindow? HOT 3
- How to use NSRange as a Block parameter? HOT 1
- Importing values from IOKit lib exceeds maximum call stack HOT 7
- Unhelpful error message when framework not found HOT 2
- xxxx.apply is not a function
- "Unexpected token 'o'" in type-encodings.js
- Can you use private frameworks with this?
- Can't introspect various symbols (e.g. require('objc').NSTitledWindowMask)
- Can we do an example for synchronizing documents in the icloud multiple devices?
- Install fails
- Support electron 21 / v8 memory cage
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 objc.