How to run "fsutil file createnew" on windows10 system?
wood3n opened this issue · comments
wood3n commented
Expected Behavior
run successfully
Actual Behavior
run failed
Steps to Reproduce the Problem
I want to use fsutil file createnew
to create large size file on windows10 system, that's my code.
#!/usr/bin/env zx
try {
// 1GB
const size = 1024 * 1024 * 1024;
await $`fsutil file createnew bigfile.txt ${size}`;
} catch (p) {
console.log(`Exit code: ${p.exitCode}`);
console.log(`Error: ${p.stderr}`);
}
It will get such a problem
Specifications
- Version: 6.0.1
- Platform: windows 10 - 19044
Anton Golub commented
https://github.com/google/zx#maxbuffer
So you can override the limit:
$.maxBuffer = 1024 * 1024 * 1024
$`cmd which requires a very large buffer`
wood3n commented
https://github.com/google/zx#maxbuffer So you can override the limit:
$.maxBuffer = 1024 * 1024 * 1024 $`cmd which requires a very large buffer`
thank you, but it seems have no effect, still has the same problem.
#!/usr/bin/env zx
try {
const size = 1024 * 1024 * 1024;
$.maxBuffer = size;
// 1GB
await $`fsutil file createnew bigfile.txt ${size}`;
} catch (p) {
console.log(`Exit code: ${p.exitCode}`);
console.log(`Error: ${p.stderr}`);
}
Anton Golub commented
Strict limit. I suggest adding a bit more bytes.
Btw, does this util return a new file contets as stdout?
Perhaps the problem is with the quotes. Can you check plz:
fsutil file createnew bigfile.txt 1000
fsutil file createnew bigfile.txt "1000"
wood3n commented
@antongolub I just test, it has nothing to do with quotes on windows.😅