Coder Social home page Coder Social logo

Comments (2)

wagoodman avatar wagoodman commented on June 14, 2024

Thanks for reporting, we'll look into this.

Use "path/filepath" instead of "path" functions for file system accesses to make it compatible with Windows and Unixes.

Looking at using path vs filepath packages might be a bit of a red herring since our file.Resolver layer normalizes windows paths to unix paths so that much of the business logic early on does not have to worry about these concerns (thus we can use path).

from syft.

Joerki avatar Joerki commented on June 14, 2024

Hi guys,

I noticed the issues at the places and command in first instance where you are NOT using you file resolver operations, but "path" functions instead of "filepath" directly! So this is absolutely not a red herring.
What I did to resolve go cataloger issues (tested on windows only):
config.go: changed "path" to "filepath" operations (goPath, g.LocalModCacheDir)
licenses.go: a glob definition must also match to the current OS. Also here Base and Join with "filepath" instead of "path"
package.go: also here you have hardcoded "/" and path.Join where file resolver is not used.

I saw that you have implemented the file resolver unindexed_directory.go, but you mix "path" and afero, and this is not platform independent and not working on Windows (so you don't normalize it properly). I did not work with afero yet, but since Windows FS is supported (I took this from their Readme), you must consider platform-independant path operations either solely with pure afero or a working mix with other platform-independent libraries like "filepath".

I hope you understood now why I wrote "fundamental" :)

BR

from syft.

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.