Re: accessing newly-created files
Re: accessing newly-created files
- Subject: Re: accessing newly-created files
- From: "David Piasecki" <email@hidden>
- Date: Mon, 19 Apr 2004 13:23:26 -0700
Allan,
I tried creating a named pipe, but I'm having some trouble reading from
it. A simple example works just fine for something like cat, but I get
a broken pipe error when attempting to read it in as an image in
Objective-C.
cat somepngfile > output_fifo
then... cat output_fifo in another terminal window, and the first
operation completes and returns just fine.
This prints the contents of sometextfile printed on screen (pretty
cool, but you already knew that).
// What's causing the problem...
NSImage *newg = [NSImage alloc];
newg = [newg initWithContentsOfFile:@"graphic.png"];
[MyImageView setImage:newg];
I'm going to try simply reading in the file the standard C/C++ way and
passing the bytes to the NSImage. Is that what you were originally
thinking? I'll let you know if it works.
David
On Apr 15, 2004, at 1:45 PM, Allan Odgaard wrote:
>
On 15. Apr 2004, at 21:04, David Piasecki wrote:
>
>
> I use a system call to execute a program which creates an image file
>
> that I want to display directly after it is written. [...]
>
>
Perhaps you can let the executed program write to a named pipe? that
>
way you can instantly start reading the image in your main
>
application. See "man 2 mkfifo".
>
>
>
>
>
>
>
** Cocoa FAQ: <http://www.alastairs-place.net/cocoa/faq.txt> **
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.