Write/read error: no such file or directory
See original GitHub issuei have this code:
const i = await jimp.read("./img/nero.jpg");
//const srcImage = await jimp.read("./img/v.png");
const font = await jimp.loadFont('./font/Windlass.fnt' /*jimp.FONT_SANS_32_WHITE*/);
await i.resize(532,392);
await i.print(font, 50, 50, 'Hello World!', 500);
await i.print(font, 200, 50, 'Test 2a riga', 500);
//i.composite(srcImage, 100, 0);
await i.write('./nero.jpg', err => console.error('write error: ', err));
await msg.channel.send({
files: [
"./nero.jpg"
]
});
fs.unlinkSync('./nero.jpg');
It gives 1 time on 2, Error: ENOENT: no such file or directory, stat ‘D:\Discord Bot\gamertags-img\nero.jpg’. I tried some things, searched, but nothing works…
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Error 2 for write/read access to a file - SAP Community
error 2 means "no such file or directory" so this most probably happens because of some inconsistency. You can do a consistency check:...
Read more >No such file or directory error while execute commands from ...
The real issue is how you populate array in the first place. Consider maintaining a collection of parallel arrays, i.e. cmd[$i] would contain ......
Read more >Unable to open /dev/sdb read-write (Read-only file system)
First try the command sudo hdparm -r0 /dev/sdb (method taken from another askubuntu answer). Then try remounting rw the partition. If these steps...
Read more >Isilon: Shares fails to load, error "Share did not load. An ... - Dell
When we open a share that has '&' in its name, it failed to load/open via CLI and GUI. Share(s) do(es) not exist:...
Read more >sed -i option giving error no such file or directory - Page 2
I created a shell with sed -i option. It is giving error - No such file or directory Ex - pre { overflow:scroll;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Basically your problem was using the callback style
write
instead of the promise basedwriteAsync
Things I changed:
ok tried again changin a bit of things, and now it seems it works. The only moment where it didn’t works, was when i type the command before the bot/program hadn’t sent the image (and the fs unlinked)
Thank you so much