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: ... ...
Laceration asked 13/12, 2013 at 16:43

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...
Risser asked 13/3, 2013 at 1:47

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...
Josiahjosias asked 13/4, 2022 at 12:34

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...
Kissinger asked 2/4, 2011 at 8:59

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 ...
Excepting asked 22/5, 2009 at 6:55

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 &lt...
Moyra asked 22/4, 2011 at 21:29

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...
Braziel asked 5/1, 2016 at 12:28

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 ?
Ontogeny asked 3/3, 2009 at 10:10

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...
Judicative asked 10/12, 2013 at 18:23

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...
Brinkema asked 9/7, 2014 at 19:31

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...
Continuant asked 9/5, 2013 at 12:0

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...
Pantelegraph asked 29/6, 2016 at 16:39

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...
Bingen asked 1/4, 2012 at 13:52

20

Solved

I have the following program: int main(int argc, char *argv[]) { char ch1, ch2; printf("Input the first character:"); // Line 1 scanf("%c", &ch1); printf("Input the...
Lissotrichous asked 26/10, 2011 at 2:48

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 ...
Railey asked 6/5, 2016 at 18:42

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...
Sordello asked 23/9, 2013 at 6:8

© 2022 - 2024 — McMap. All rights reserved.