GithubHelp home page GithubHelp logo

Comments (2)

samuelcampos avatar samuelcampos commented on June 29, 2024

We use diferent strategies to find drives on different systems. That might explain the different behaviour between Windows and Linux.

On Windows, it is not detecting DriveType 3 because I was not able to distinguish between an external disk DriveType 3 and the computer's default hard disk.

I think that Windoes detects USB sticks as DriveType 2 regardless of the filesystem. However, it does not behave the same for external hard drives.

At this point, my only idea is to expose some config or input parameter for the developer to choose if he wants to detect changes (connections/removals) of normal hard drives (all devices with DriveType 3).

What do you think?

from usbdrivedetector.

Avec112 avatar Avec112 commented on June 29, 2024

Apologies for not answering earlier. I think an option to configure any fixed/stationary HDD of DriveType 3 would be a valid solution. Maybe a blacklist and whitelist configuration option could solve what to monitor and not.
I almost implemented a sort of "whitelist" myself. Inside the monitor I only want to trigger my application when the usb stick is named "x". All other usb findings are being ignored.

detector.addDriveListener(e -> {
  var device = e.getStorageDevice();
  if(isCorrectDevice(device) && e.getEventType().equals(DeviceEventType.CONNECTED)) {
    // get/put files from/to device  
  }
});

from usbdrivedetector.

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.