io

Does it make sense to use `java.nio.file.spi`to implement access to a remote file system?

Basically I write an application which copies/moves files from the local file system to a remote file system over some FTP-like protocol. Would it be a good approach to encapsulate the protocol-specific bits inside of the file system service provider interface? As far as I understand that would make my library work with other applicati...

Haskell IO with non English characters

Hi all . Look at this , i am try appendFile "out" $ show 'д' 'д' is character from Russian alphabet. After that "out" file contains: '\1076' How i understand is the unicode numeric code of character 'д'. Why is it happens ? And How i can to get the normal representation of my character ? For additional information it is works...

Boost mmap performance vs native memory maps.

I will be writing a benchmarking tool that will test a mix of IOPS and bandwidth of a disk system and as such I will be turning to file backed memory maps for IO. Because the tool is going to need to be on both POSIX and WinNT platforms I can't just use plain old mmaps. Also from what I understand you have to madvise the Linux kernel tha...

Flashdevelop + haxe -- repeated "An I/O error has occured" errors

I'm getting small dialog boxes that pop up saying I/O Error occurred. What causes this, and how should I fix this? Edit: what happens is that after i run my flash game, FlashDevelop will try to connect to the Flash debugger, but apparently fail and give me the above error. I have both the debug standalone player and the ActiveX debug co...

Ruby HTTP Request

Ruby req = Net::HTTP.get_response(URI.parse('http://www.domain.com/coupons.txt')) @play = req.body req.body give me the entire page in to a string. What if I just want to read line by line? gets? Can you read line by line through a http get? Or do I just need to read a file from local? The text file looks like this 1 John Ham 25,0...

Java's [Input|Output]Streams' one-method-call-for-each-byte: a performance problem?

[Input|Output]Streams exist since JDK1.0, while their character-counterparts Readers|Writers exist since JDK1.1. Most concepts seem similar, with one exception: the base classes of streams declare an abstract method which processes one single byte at a time, while base readers/writers classes declare an abstract method which processes w...

Why can Haskell exceptions only be caught inside the IO monad?

Can anybody explain why exceptions may be thrown outside the IO monad, but may only be caught inside it? ...

Java: What sense could it make not to close an InputStream after it ended?

InputStream implements Closeable. I understand, that closing an InputStream which not ended yet, could make sense to free some underlying resources, and, leaving it open, could make sense to let other methods continue to read from it. But, what sense could it have not to close an InputStream after it ended? And if it doesn't make sense...

F#, System.IO.IOException: All pipe instances are busy

Hi I have a F# application that communicates with a java application via named pipe. Where F# acts as server and java acts as client. The application works for the most part except that the F# runes in to “System.IO.IOException: All pipe instances are busy” error occasionally. Below is the full stack trace of the exception and code snip...

Does fwrite call any lock internally?

In solaris when I attached dbx to one of the running stacks, I found the call to fwrite leading to __lll_lock_wait()? In what scenario will this happen? Does fwrite internally tries to acquire a lock? ...

Can fwrite & fclose be called parallely from two threads for the same file descriptor?

What will happen if fwrite & fclose are called in parallel from two threads for the same file descriptor? ...

Need help reading from a txt file in C

Hello, I am working on a project in C which requires me to read in matrix values from a txt file. The first two lines are the number of rows and columns, and the rest is the actual matrix data. For example, something like this: 2 2 1.0 2.0 3.0 4.0 The code I wrote is giving me some issues. Here's a snippet: matrix read(char* file...

Blocking operations and ZeroMQ

Hi, I'm designing a distributed system in which a single-threaded server processes perform a CPU intensive operation. These operations are triggered by ZeroMQ network messages. If the single-threaded process is performing the CPU intensive work, will the I/O (ZeroMQ sockets) block? Thanks! ...

How to convert javax.xml.transform.Source into an InputStream?

How can I convert a javax.xml.transform.Source into a InputStream? The Implementation of Source is javax.xml.transform.dom.DOMSource. Source inputSource = messageContext.getRequest().getPayloadSource(); ...

What is the purpose of hard disk direct memory access?

At first glance it seems like a good idea to let the hard disk write to RAM on its own, without CPU instructions copying data, particularly with the success of asynchronous networking in mind. But the Wikipedia article on DMA states this: With DMA, the CPU gets freed from this overhead and can do useful tasks during data transfer (th...

Windows: Child Process with Redirected Input and Output

Hello, I'm trying to create a Child Process with Redirected Input and Output (as described here - http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx). For the people that don't want to bother reading the source code on that page, the author is using anonymous pipes to redirect the child's input and output. The parent proc...

D file I/O functions

I'm just learning D. Looks like a great language, but I can't find any info about the file I/O functions. I may be being dim (I'm good at that!), so could somebody point me in the right direction, please? Thanks ...

very simple io question c++

Just started learning c++ today and im pretty boggled. its an amazing language but im having some trouble overwriting a file #include <iostream> #include <fstream> using namespace std; int main( ) { double payIncrease = 7.6; double annual; double annualIncrease; double newAnnual; double monthlyIncrease; doub...

[Java] I/O why does a byte can represent a character?

and i see the character are only ASCII then its not dynamic right? any explanation for this? other question, what is the difference between byte streams and character streams? ...

How do you "empty" a StringWriter in Java?

What is the correct way to "empty" a StringWriter in Java so that I can reuse the StringWriter without having to create a new one? Neither StringWriter.flush() nor StringWriter.close() seem to have the desired effect. ...