io Questions
3
Solved
I am trying to interact with an external program in C using pipe, fork and exec. I want to force the external program to perform unbuffered I/O. Here's a relevant snippet from my code so far:
...
...
3
Solved
I'm working with an IO object (some STDOUT output text), and I'm trying to convert it to a string so that I can do some text processing. I would like to do something like this:
my_io_object = $std...
3
Solved
I am doing some exercise from the book Grokking Functional Programming, the origin code examples are written in Scala, and I want to rewrite it with Raku.
In Scala's cats effect library, there is a...
Sherard asked 4/2 at 7:57
2
I have a python web application written using FastAPI (running via uvicorn). In my app I'm using the standard logging module which uses TimedRotatingFileHandler. Since I'm logging into a file I'm c...
5
Solved
I'm not sure what people usually mean by "lock" a file, but what I want is to do that thing to a file that will produce a "The specified file is in use" error message when I try to open it with ano...
16
I have been coding in C++ for a long time. I always wondered which has a faster execution speed printf or cout?
Situation: I am designing an application in C++ and I have certain constraints such ...
14
Solved
How do I check if a directory exists in lua, preferably without using the LuaFileSystem module if possible?
Trying to do something like this python line:
os.path.isdir(path)
Bronze asked 27/8, 2009 at 10:37
12
I am testing some code which processes registration to a website. The java code is as follows (excerpt):
if (request.getParameter("method").equals("checkEmail")){
String email= request.getParamet...
Amberly asked 24/6, 2013 at 21:21
10
Solved
How can I print 0x0a, instead of 0xa using cout?
#include <iostream>
using std::cout;
using std::endl;
using std::hex;
int main()
{
cout << hex << showbase << 10 <...
5
Solved
I'm making a small ncurses application in Rust that needs to communicate with a child process. I already have a prototype written in Common Lisp. I'm trying to rewrite it because CL uses a huge amo...
11
Solved
C++ file I/O is tougher than C file I/O.
So in C++, creating a new library for file I/O is useful or not? I mean <fstream>
Can anyone please tell are there any benefits in C++ file I/O ?
3
Solved
I have a text file in the following format:
info
data1 data2
info
data1 data2 data3 data4...
The problem is: the count (and length) of the data may be very large and cause run-time problems when...
5
Solved
I am trying to solve a big numerical problem which involves lots of subproblems, and I'm using Python's multiprocessing module (specifically Pool.map) to split up different independent subproblems ...
Campbell asked 19/11, 2012 at 1:13
2
Solved
.NET 4.5 has added new classes to work with zip archives. Now you can do something like this:
using (ZipArchive archive = ZipFile.OpenRead(zipFilePath))
{
foreach (ZipArchiveEntry entry in archiv...
Inveracity asked 10/9, 2016 at 0:20
32
Solved
I'm using the subprocess module to start a subprocess and connect to its output stream (standard output). I want to be able to execute non-blocking reads on its standard output. Is there a way to m...
Langtry asked 17/12, 2008 at 17:56
4
Solved
I've create a JSON file, and I need to be able to share the file via email with other collaborators. However, although there are plenty of topics available on handling JSON objects in the R workspa...
7
I am aware that flip() set the current buffer position to 0 and set the limit to the previous buffer position whereas rewind() just set the current buffer position to 0.
In the following code, eith...
5
Solved
Is there a way to determine the size of the HTTPServletResponse content? I read this get-size-of-http-response-in-java question but sadly where I work I do not have access to CommonsIO :(
The resp...
Skylark asked 25/3, 2011 at 16:35
33
I am having a problem where I am trying to delete my file but I get an exception.
if (result == "Success")
{
if (FileUpload.HasFile)
{
try
{
File.Delete(Request.PhysicalApplicationPath + app_...
Dichromic asked 11/1, 2012 at 14:58
6
Solved
I noticed that if I iterate over a file that I opened, it is much faster to iterate over it without reading it first. That is:
l = open('file','r')
for line in l:
...
is much faster than
l = open...
9
I have text file that was encoded with UTF8 (for language specific characters).
I need to use RandomAccessFile to seek specific position and read from.
I want read line-by-line.
String str = m...
20
Solved
3
Solved
What is the most efficient general purpose way of reading "large" files (which may be text or binary), without going into unsafe territory? I was surprised how few relevant results there were when ...
5
I have a SPARK project running on a Cloudera VM. On my project I load the data from a parquet file and then process these data. Everything works fine but The problem is that I need to run this proj...
Bullock asked 15/1, 2016 at 15:9
7
Solved
import csv
with open('v.csv', 'w') as csvfile:
cwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
for w, c in p.items():
cwriter.writerow(w + c)
Here, p i...
© 2022 - 2024 — McMap. All rights reserved.