Giter VIP home page Giter VIP logo

Comments (5)

sharifhsn avatar sharifhsn commented on August 27, 2024 1

Checking Windows's own more utility, it returns the same error: The system cannot find the path specified.

This Stack Exchange thread gives more detail on why, but suffice it to say that unlike in Unix-like operating systems, Windows does not just let you access volumes/drives just like you can a file. I did some digging into the Windows file access methods and found that CreateFileW should allow you to access a drive as a file. The winsafe library provides a safe wrapper for this method through its own File::open method. Note that this File uses its own read which wraps ReadFile and does not implement std::io::Read, so in order for this to be implemented into hexyl one would have to create a wrapper struct for it and implement Read on it, in addition to writing logic that would recognize the file path as a drive and handle it as a special case.

EDIT: After some more research, I found the FileMapped struct which will open the drive as a [u8], which does implement Read. The only implementation details left would be handling the path and adding it as an additional variant of Input.

My access to Windows is limited and I would not be able to test this implementation, so I would not be able to contribute to it. However, @whitequill, if you're interested in getting this to work, I've provided all the necessary details here to implement this yourself.

from hexyl.

sharkdp avatar sharkdp commented on August 27, 2024

I was trying to open a device in hexyl with hexyl.exe \\?\Volume{0893efeb-32d9-46d8-bc15-34d18c0e669a}\
does it not have this functionality yet?

I'm not a Windows expert, so I don't really know what you expect this to do. Can other tools open this exact path?

from hexyl.

whitequill avatar whitequill commented on August 27, 2024

I want to open a device like I would open hexyl /dev/hde1 on Linux.

from hexyl.

sharkdp avatar sharkdp commented on August 27, 2024

Can other tools open this exact path?

from hexyl.

whitequill avatar whitequill commented on August 27, 2024

I will give this some thought. As I need to look at the current hexyl code base and the Microsoft documentation.

from hexyl.

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.