Welcome to the Linux Foundation Forum!

Found bug in labs Ch-10 validate js

Windows 10:

validate.js writes a preload file to open ip file with single '\' path separator,
_const ip = fs.readFileSync('C:\Users\sukhw\AppData\Local\Temp\ch-10-labs-123GQBJ\ip', {encoding: 'utf8'})
_
but it doesn't work on windows, it give error 'cant open file 'C:UserssukhwAppDataLocalTempch-10-labs-123GQBJip'
So I had to change validate to use '\' as path separator, the it writes preload file as below and works fine
const ip = fs.readFileSync('C:\Users\sukhw\AppData\Local\Temp\ch-10-labs-123GQBJ\ip', {encoding: 'utf8'})
and it works fine

Comments

  • It seems on save this post, double slashes also got converted into single slash, so I am trying again,
    my solution was to update validate.js to write preload using double slash as path separator.
    "const ip = fs.readFileSync('C:\\Users\\sukhw\\AppData\\Local\\Temp\\ch-10-labs-123GQBJ\\ip', {encoding: 'utf8'})"

  • xdxmxc
    xdxmxc Posts: 139

    it should be using path.join, I'll take a look at this as part of the major update

Categories

Upcoming Training