filehandle Questions
2
i have been scratching my head and been searching for an answer for this for hours now. Basically what I do is open a socket to some other machine and reading the data from it. This socket is than ...
Unalienable asked 9/4, 2012 at 17:44
8
Solved
I am doing a lot of image processing in GDI+ in .NET in an ASP.NET application.
I frequently find that Image.FromFile() is keeping a file handle open.
Why is this? What is the best way to open an...
Anandrous asked 25/4, 2009 at 6:18
4
Solved
I would like to send data from within my C++ program to an external pipeline, like so:
FILE* file = popen("my_prog -opt | other_prog", "w");
std::ostream fileStream = some_function(file);
fileStre...
Clyte asked 14/11, 2015 at 22:36
3
Solved
I am creating a small shell that can read commands. When I run my program and type:"cat file.txt > file2.txt" it creates the file and then it gets stuck at the line: if(execvp(structVariables-&g...
Hsinking asked 20/7, 2015 at 14:42
3
Solved
Similar to Can I find a filename from a filehandle in Perl? but in Tcl.
I plan to cache filename-filehandle associations anyway, so I'm asking purely out of curiosity--particularly of the "operati...
Berber asked 28/2, 2012 at 17:2
1
Solved
In Perl 5, I can create a filehandle to a string and read or write from the string as if it were a file. This is great for working with tests or templates.
For example:
use v5.10; use strict; use...
Provinciality asked 24/2, 2015 at 17:54
0
I've been working with the code form this answer, provided by Martin R. The code is awesome and it is very useful. However, it doesn't work with the links, while working fine with files. After putt...
Rutter asked 31/10, 2014 at 11:57
2
Solved
Perl has the feature that strings named like a file handle are taken to be a filehandle:
# let this be some nice class I wrote
package Input {
sub awesome { ... }
}
So when we do Input->awes...
Sobersided asked 26/4, 2014 at 14:18
5
Solved
I'm on a server where I'm limited to PHP 5.2.6 which means str_getcsv is not available to me. I'm using, instead fgetcsv which requires "A valid file pointer to a file successfully opened by fopen(...
Debora asked 16/2, 2010 at 21:50
2
Solved
I read in the perldoc that the -t file operator is used to decide if a filehandle is opened to a tty or not. Then i read what a tty was and from what i understand it's an old term for a terminal?
...
Dees asked 2/12, 2013 at 15:48
2
Solved
I apologize if this question sounds simple, my intention is to understand in depth how this (these?) particular operator(s) works and I was unable to find a satisfactory description in the perldocs...
Plasticity asked 17/9, 2013 at 20:2
2
Solved
I have a very big-size string $s="dfasdfasdfafd....", of nearly 1,000,000 characters. I want to convert it to a file handle, making it look like this string is read from a file. But I don't want to...
Falzetta asked 12/9, 2013 at 8:48
1
I have a class that will let me close process handles in a given process. I have the fundamentals down, and it works flawlessly in Win7 x64, but when I run it in WinXP x86, it hangs and I can't und...
Aviate asked 21/4, 2013 at 4:22
2
I need to add timers support in an application based on I/O Completion Ports (IOCP). I would like to avoid the use of a specific thread to manage timers.
On Linux, you can create a timer that deli...
Dido asked 13/7, 2010 at 16:11
2
Solved
The documentation for the open function shows the syntax of open() as:
open FILEHANDLE,EXPR
open FILEHANDLE,MODE,EXPR
open FILEHANDLE,MODE,EXPR,LIST
open FILEHANDLE,MODE,REFERENCE
open FILEHANDLE...
Trulatrull asked 29/6, 2013 at 2:38
5
Solved
Is there any easy way to tell perl "now ignore everything that is printed"?
I have to call a procedure in an external Perl module, but the procedure prints a lot of unnecessary information (all th...
Tetracycline asked 4/9, 2009 at 0:8
3
Solved
A simple program with while( <> ) handles files given as arguments (./program 1.file 2.file 3.file) and standard input of Unix systems.
I think it concatenates them together in one fil...
Trustful asked 17/2, 2013 at 14:46
1
Solved
Question
How can I support autovivified filehandle arguments in an XS function?
I'm XS-wrapping a C function which returns a file descriptor, and I'd like to present that file descriptor as a per...
Cretin asked 21/12, 2012 at 20:20
3
Is it possible to send a file handle as an argument to a subroutine in PERL?
If yes, can you help with a sample code snippet showing how to receive it and use it in the subroutine?
Nationality asked 4/12, 2012 at 11:51
1
Solved
I read a few lines from STDIN. How can I pass the remaining of STDIN to a command that reads from standard input (e.g. md5sum or wc)?
I could do a:
read_a_few_lines_from_diamond_operator();
open ...
Sharpie asked 30/8, 2012 at 23:4
2
Solved
I opened a file to read from line by line:
open(FH,"<","$myfile") or die "could not open $myfile: $!";
while (<FH>)
{
# ...do something
}
Later on in the program, I try to re-read the ...
Clerkly asked 20/8, 2012 at 19:8
2
Solved
I'm trying to figure out how to get a Perl module to deference and open a reference to a filehandle. You'll understand what I mean when you see the main program:
#!/usr/bin/perl
use strict;
use wa...
Cornelius asked 16/7, 2012 at 20:49
3
Solved
open(my $fh, '>', $path) || die $!;
my_sub($fh);
Can my_sub() somehow extrapolate $path from $fh?
Loaf asked 11/5, 2010 at 17:48
5
Solved
I am working on a program that take user input for two file names. Unfortunately, the program can easily break if the user does not follow the specified format of the input. I want to write code th...
Licit asked 9/6, 2012 at 1:30
1
Solved
What This Question Is Not About
This question is not about how to auto-close a file with File#close or the File#open block syntax. It's a question about where Ruby stores its list of open file des...
Palikar asked 6/6, 2012 at 20:48
© 2022 - 2024 — McMap. All rights reserved.