Comments (4)
Most likely the problem is not with your library. I tried to do file deletion in C++ and through the library generated by Visual Studio. It still freezes. Maybe you have any idea why this might be happening?
UPD After several experiments, I found that the more files on the device, the more freezing after deletion. If there are about 2000 files on the device, the freeze may take about 10 seconds.
from mediadevices.
This library is only a .NET wrapper for the windows MTP COM component. If this component neends a lot of time for the delete the library is waiting. You can try to get a list with all files and use a loop to delete each file with a single call. So you can show a progress bar.
from mediadevices.
In fact, that's what I did. But after the first or second removal, the COM object hangs. The freeze time depends on the number of files on the phone. It is even less if you use the generated DLL to access a COM object. But if you delete it through Explorer, then everything is deleted normally. And it most likely uses the same API, since it also hangs up to make an uninstallation from the program.
Hanging can reach about 10-20 seconds with 2-3 thousand files on the phone. Which is very inconvenient. I thought at the beginning that it was in the library, but after some experiments, I realized that it was in the COM object. And it doesn't matter what language to use it through. And freezes happen regardless of the system or phone.
Unfortunately, I do not have enough knowledge to figure out what happens inside the component during file deletion. But can you tell me which way to look?
from mediadevices.
After deleting a file the underlying Windows MTP library needs a verly long time to update the cache.
Retry with version 1.10 and disabled cache.
from mediadevices.
Related Issues (20)
- OutOfMemoryException when downloading large files HOT 2
- Get Serial Port name? HOT 1
- Exception in `MediaDevice.VendorOpcodes` - 'ToInt does not work for value type VT_UI4'
- Thumbnail rotation
- HasFiles() / HasAnyFile() on directory
- thread safety HOT 1
- Provide a basic simple example HOT 1
- DownloadFile
- Mount `/` instead of `/storage/emulated/0/`
- VT_ERROR: 0x80070490 HOT 1
- MediaDeviceEventArgs how to use HOT 2
- Not an issue but rather a thank you HOT 2
- Reusing the same MemoryStream object for UploadFile throws COMException with HRESULT 0x800704C7 HOT 2
- Slow performance when using UploadFile with MemoryStream HOT 3
- Device cannot connect again HOT 8
- Expose writing Stream on MediaFileInfo HOT 1
- Avoid operation delay after delete object by setting the COOKIE policy HOT 2
- Checksum HOT 1
- UploadFile() issues HOT 1
- Redmi 9T: Can't get device friendly name 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 mediadevices.