This tag refers to the process of writing text or data to a file.
Questions tagged [file-writing]
932 questions
4
votes
1 answer
How to check when ffmpeg completes a video segment?
I'm using a ffmpeg Process from within my C# program. I start it off and run it in segmented mode.
ffmpeg -i rtsp://127.0.0.1/axis-media/media.amp?resolution=1280x720 -c copy -map 0 -f segment -segment_time 21600 -strftime 1 -reset_timestamps 1…

Matthew Czarnek
- 341
- 3
- 13
4
votes
1 answer
Python tempfile with a context manager on Windows 10 leads to PermissionError: [Errno 13]
OS: Windows 10
Python: 3.6 (Anaconda)
I am trying to use a simple temporary file with a context manager to write a simple csv.
import csv
import tempfile
fp = tempfile.TemporaryFile()
with open(fp.name,'w',newline='') as f:
csv_out =…

Cale Sweeney
- 1,014
- 1
- 15
- 37
4
votes
2 answers
Understanding K&R's putc macro: K&R Chapter 8 (The Unix System Interface) Exercise 2
I've been trying to understand K&R's version of putc for some time now, and I'm out of resources (google, stack overflow, clcwiki don't quite have what I'm looking for and I have no friends or colleagues to turn to). I'll explain the context first…

ThornyHatcher
- 61
- 5
4
votes
2 answers
Python: Writing certain columns specified by user to new file
If I have a file with multiple columns e.g.
0, 1, 2, 3, 4, 5, 6
a, b, c, d, e, f, g
And I would like to write certain columns to a new file, where the column numbers are stored in a list col=[]. How would this be done using an iteration of the…

Pankaj Kumar
- 43
- 4
4
votes
1 answer
Storing a list of objects as csv in python
I am writing a program that scrapes a website and extracts the names and the links from a table. I store each name and respective link in an object and append it to a list of objects by running a for loop. I want to save this list as a csv file, but…

Sarim Zia Khan
- 53
- 1
- 1
- 4
4
votes
2 answers
Write each row of a spark dataframe as a separate file
I have Spark Dataframe with a single column, where each row is a long string (actually an xml file).
I want to go through the DataFrame and save a string from each row as a text file, they can be called simply 1.xml, 2.xml, and so on.
I cannot seem…

user1219520
- 95
- 2
- 7
4
votes
2 answers
Python: Writing int to a binary file
I have a program which calculates the offset(difference) and then stores them in an 16 bit unsigned int using numPy and I want to store this int into a binary file as it is in binary form. i.e. if the value of offset is 05, I want the file to show…

omkar joshi
- 83
- 2
- 9
4
votes
2 answers
Writing to a file in C
Below i have a piece of code that i believe is very simple but for some reason will not work, as i get the error savedMap.c:20: warning: implicit declaration of function ‘fPrintf’. The code is:
#include "Structures.h"
#include "main.h"
#include…

move
- 57
- 4
4
votes
2 answers
How to properly append lines to already existing file
I looked over the internet trying to find a solution for writing line by line into a file in c. I found solutions like changing the mode of fopen() to w+, wt, wb but it did not work for me. I even read to put \r instead of \n in the end of the line…

user193239
- 109
- 2
- 2
- 12
4
votes
1 answer
How to write the data to USB stick(Pendrive) from the application in android
In my application i have to write the Data to USB stick(Pendrive) from the application.
My application will support to write the data to Local memory and USB stick(Pendrive).
Currently i am able to write the data to Local memory ,but i am unable to…

Ashok Reddy Narra
- 577
- 10
- 27
4
votes
2 answers
How to round a numpy stacked array when written to file?
I am trying to write multiple arrays to a file using numpy.column_stack but I cannot round it to two decimals. Here is the reproducible code:
import numpy as np
A = np.array([1.1334, 4.10343, 12.4343])
B = np.array([2.1334, 5.12343, 16.23543])
C =…

Tom Kurushingal
- 6,086
- 20
- 54
- 86
4
votes
2 answers
overwriting a specific line on a text file?
how do I go about overwriting a specific line on a text file in c?. I have values in multiple variables that need to be written onto the file.

silent
- 2,836
- 10
- 47
- 73
3
votes
4 answers
C# MVC Access to path denied when trying to write file
I have an MVC application in which users are able to upload files. Before I write the uploaded file, I create a directory according to date time. I start off with C:\ApplicationName and end up with C:\ApplicationName\20111001\Filename.ext when the…

TheGuest
- 415
- 1
- 4
- 14
3
votes
5 answers
Writing to a file in Java: Cannot find the path specified
I am having enormous difficulty writing to a simple text file in Java. Every search I've done for the IO exception I'm getting is turning up plenty of suggestions, but none of them apply to this situation.
Here is my project…

IAmYourFaja
- 55,468
- 181
- 466
- 756
3
votes
2 answers
Is NSTemporaryDirectory() violate with Mac App Store Guidelines?
I have to submit an application to Mac App Store and got rejected from Apple by this reasons
Apps that do not comply with the Mac OS X File System documentation will be
rejected
In guidelines suggest to write file the following…

meddlesome
- 551
- 7
- 20