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
-1
votes
2 answers

Update: Python average income reading and writing files

I was writing a code to find the average household income, and how many families are below poverty line. this is my code so far def povertyLevel(): inFile = open('program10.txt', 'r') outFile = open('program10-out.txt',…
-1
votes
2 answers

C++ WriteFile only writing 4 bytes

Here's what I'm trying to achieve; I'm hooking onto the HttpSendRequest function (on Xbox it's XHttp) and trying dump the certificate that's in pcszHeaders which has the size of 0x1F0E. Now the problem; it only seems to write 4 bytes, I've even…
Corona
  • 255
  • 4
  • 17
-2
votes
0 answers

Flutter: Include custom Text file at installation

I have an app that saves Data from user input to a specific file. For that i use final path = getApplicationDocumentsDirectory(); to get the Location, and file = File('$path/games_file.txt'); to get the file and then file.writeAsString(...) to write…
Washbear
  • 47
  • 5
-2
votes
1 answer

An Efficient Way To Store class Data to a File in C++

I have created a School Management System and it is working fine. I store all the information of the students in the file and read them back to the program when opened. However, my question is in how to write to file. If there is a better way to…
HBatalha
  • 202
  • 2
  • 9
-2
votes
2 answers

Want to write to a file but I get the failure "Access to the path xy denied."

I am trying to write the data of a heartrate puls belt to a file. Everytime I start the programm it says "Access to the path denied". The file is not "read-only". I also tried this from another question: File.SetAttributes(file,…
Leo Ge
  • 31
  • 2
-2
votes
1 answer

How to write the below result in a file in python/How to store the results?

Have made a python GUI and now I want to store the variable say Reference and Total cost in a file. How can I achieve that? Have tried writing a file like: def writetofile(): import os outputname ='tutorial.txt' a= "TotalCost" …
roxy007
  • 1
  • 1
-2
votes
3 answers

[WIN API]Why sharing a same HANDLE of WriteFile(sync) and ReadFile(sync) cause ReadFile error?

I've search the MSDN but did not find any information about sharing a same HANDLE with both WriteFile and ReadFile. NOTE:I did not use create_always flag, so there's no chance for the file being replaced with null file. The reason I tried to use the…
Lynch Chen
  • 94
  • 1
  • 10
-2
votes
2 answers

C# - Write line if line doesn't exist

I'm trying to write a line in a CSV file as a string if the exact string doesn't exist in the CSV file already. My code works fine for me when I don't check if the line exists. My current code looks as the following and just doesn't seem to…
Nico Roos
  • 11
  • 1
-2
votes
4 answers

Writing to file using Python

I have a file called output.txt, which I want to write into from a few functions around the code, some of which are recursive. Problem is, every time I write I need to open the file again and again and then everything I wrote before is deleted. I am…
aviadm71
  • 53
  • 1
  • 8
-2
votes
1 answer

use writefile to write raw usb c++

this is my code : #include #include #include #include #include #include #include #include int main(int argc, CHAR* argv[]) { PVOID data[1024]; DWORD dwBytesRead…
-2
votes
1 answer

Three nested Object to file *.txt in C++

i want write an Object to file (*.txt) class MyCircle{ double x; double y; double radius; char index; int check;} class Question{ int index; int quantityOfAnswers; MyCircle [] arrCircles; …
Jetly_93
  • 11
  • 5
-2
votes
1 answer

store Prolog answers to a file

I'm working with ALEPH reasoning engine in SWI-Prolog. I want to save the rules that ALEPH infers and shows them in SWI-Prolog console, but I have no idea how can I do it! The sample result is depicted in the picture below, [Rule 134] [Pos cover =…
Arsham
  • 1
-2
votes
3 answers

Extracting lines from a text in python

I am trying to extract the lines that start with this entries and create a new file. This is what I have: def ReadFileContents(): file_content = open('Testing.pdb') all_file_content = file_content.readlines() list3 = [] for line in…
pedro
  • 11
  • 1
  • 4
-3
votes
2 answers

How to write the form information to a local txt archive using javascript/jquery?

I need to write a js function to write the form information into a .txt i will not use database in this project, i will use .txt files to control everything, products, person, employee , etc. All they will be at a .txt called control.txt with the…
-3
votes
1 answer

Precision issues with dlmwrite / dlmread

I recently discovered, quite harshly, that Matlab's dlmread and dlmwrite don't store numerical values at double accuracy. It effects my code, and I need to store big arrays with more precision. A (not) working example : pi1 =…
Amir Sagiv
  • 356
  • 5
  • 22
1 2 3
25
26