This tag refers to the process of writing text or data to a file.
Questions tagged [file-writing]
932 questions
2
votes
3 answers
Using PHP to store results of a post request
Im currently working with an API which requires we send our collection details in xml to their server using a post request.
Nothing major there but its not working, so I want to output the sent xml to a txt file so I can look at actually whats…

Paul M
- 3,937
- 9
- 45
- 53
1
vote
3 answers
Recommended way of writing to a Hidden/ReadOnly File C#
I am trying to write to a file which has the following attributes - Hidden and ReadOnly. My process should be able to write to it but other processes have ReadOnly Access.
The procedure that I am following is:
Check if file exists
Remove the…

user591410
- 3,051
- 5
- 21
- 30
1
vote
2 answers
How to append text to an existing text file
I have a program, which writes data to a text file in the following format.
test1 - test1 - test1 - test1
After writing the first line, the text fields are cleared to make space for another round of user input. Simply said,…

Isuru
- 30,617
- 60
- 187
- 303
1
vote
1 answer
append issue while triying to write data
I'm trying to write data to a csv file, through the below code.
Html
1
vote
3 answers
Not Writing in File Python
I have a Threaded class in which I am trying to append data but it is not doing anything, no error no success. The following is the basic structure of code
from threading import Thread
class ABC:
def func1(self, user):
# Do processing
…

farhan jatt
- 509
- 1
- 8
- 31
1
vote
1 answer
R file function: what the default value of open actually does?
Take this example, where we use the default value of the open parameter of the file function:
❯ R
> fh <- file("test.txt")
> writeLines("1", fh)
> writeLines("2", fh)
> close(fh)
> quit()
The resulting file only contains the last line:
❯ cat…

robertspierre
- 3,218
- 2
- 31
- 46
1
vote
0 answers
Encoding problem writing file using nest.js
We're doing an integration between SAP BTP Document Management Service with a nest.js service to send and download files from repositories.
When I try to download any file, I got an encoding problem in the written file, no matter which encoding I…

Daniel Cabral
- 11
- 1
1
vote
1 answer
Unexpected behavior in Visual C when writing and reading binary file with struct data
I am hanging on this problem since morning and found no solution. Also it gives various errors like, TESTING.exe has triggered a breakpoint, previously it was complaining about heap corruption other time it was cannot write data etc. I am using…

Rakesh Solanki
- 59
- 6
1
vote
1 answer
how can I write to a file in as assembler?
I want to write a text to a file that i take from argv[1] but for some reason, it returns this Error:
[1] 5590 segmentation fault (core dumped) ./hey hey.txt
Here is my code:
.section .data
.equ SYS_OPEN, 5
.equ SYS_CLOSE, 6
…

Awolez
- 11
- 4
1
vote
0 answers
Writing a byte buffer at a specific offset within the file in Java. (Equivalent of NodeJs fs.write )
I need to write bytes to a file from multiple threads in java, at a specific offset of the file.
The fs.write from NodeJS takes the next arguments:
fs.write(fd, buffer, offset, length, position, callback)
The "position" argument reffers to the…

xplore
- 11
- 1
1
vote
0 answers
Why wont py script write file?
Shouldnt it create a file and write asd in it? When it prints out fgh.