Code Monkey home page Code Monkey logo

Comments (4)

snowy-owll avatar snowy-owll commented on August 29, 2024

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.

Bassman2 avatar Bassman2 commented on August 29, 2024

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.

snowy-owll avatar snowy-owll commented on August 29, 2024

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.

Bassman2 avatar Bassman2 commented on August 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.