var fs = require('fs')
fs.open('../src/urls.js', 'w+', function(err, fd) {
fs.write(fd, 'const DEV = false\r\n', 0, function(err, bytes) {
})
})
这段代码在执行时为什么会提示TypeError:First argument must be file descriptor,明明fd就是open传过来的descriptor啊?求解
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
判断一下是不是打开失败了,如果打开失败,fd肯定就不是文件描述符了