Questions tagged [writefile]

It is most often used when someone wants to add/insert content to file programmatically, such as using Javascript function writefile, one can be able to create and write content to a file.

e.g.

const data = new Uint8Array(Buffer.from('Hello Node.js'));
fs.writeFile('message.txt', data, (err) => {
  if (err) throw err;
  console.log('The file has been saved!');
});
380 questions
-4
votes
1 answer

Moving files to multiple destination

I am trying to move files in path folder to multiple destination directory. So my condition is 70 percent of files to move to dest1 and 30 percent to dest2. What i tried so far gives me some error. I am not sure if the logic is wrong or how to do…
-4
votes
1 answer

How to write double[,] data in C#?

I have a data array double[8,2000000] (4 rows and 2 million columns) and I want to save to file on disk every second. The format is text or BIN. I tried to use streamwriter to write file but it need more than 1 sec. File.write doesn't support the…
Dong Thin
  • 11
  • 1
-4
votes
1 answer

C++ WriteFile doesnt work and returns 5 ( GetLastError() ), even tho i have admin permition

Ok so, im making this programm that lets me access and write in a usb device. Im having this problem that, when i try to run the WriteFile( hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped ); it…
thecner
  • 3
  • 1
  • 1
  • 6
-5
votes
3 answers

How can i rewrite the characters which read from text file to a new text file in c?

I have a file whose name is test.txt. I want to read character by character from the file. Then start writing from "start" to "stop" a new file, its name is main.txt. I tried to code, however it did not run. Please help…
bdllhtlgn
  • 31
  • 6
-6
votes
2 answers

Why file read write functions don't work in Visual Studio Code?

Whenever I try to run this code I keep getting error as shown on the terminal. Please help
1 2 3
25
26