A file handle is an abstract indicator for accessing a file. It is retrieved after successfully opening the file using the file name. Afterwards the file handle is used instead of the file name for all file operations.
Questions tagged [filehandle]
407 questions
0
votes
1 answer
filehandle options not coming up
I have typed the following code in from a tutorial and i cannot get it to work...
It says "No visible @interface for 'NSFilemanager' declares the selector .....
for the [fileHandle seekToEndOfFile]; [fileHandle writeData:[resultLine…

MHG
- 29
- 5
0
votes
1 answer
Perl cannot close files on Windows?
I am encountering a very strange behavior.
My Perl program is trying to close some files on Windows. It turns out that the files do not close - and there is no error message.
How do I know that the files do not get closed? Because when trying to…

Helen Craigman
- 1,443
- 3
- 16
- 25
0
votes
1 answer
perl share filehandle with threads
I've found the code below online, it seems the way the program control the loop is to check the shared variable $TERM is 0 or not. Can I share a filehandle between threads, that every thread deal with one line of a file and loop ends when the file…

lolibility
- 2,187
- 6
- 25
- 45
0
votes
1 answer
In Perl can I create my data in Excel worksheet instead of a text file. And use the character "|" as a delimiter
In Perl can I create my data in Excel worksheet instead of a text file. And use the character "|" as a delimiter. I am using the following code to create a text file
for(my $j = 0; $j < $num2; $j++) {
print {$out} …

mkumars
- 501
- 3
- 9
- 19
0
votes
3 answers
perl while nest when read files
I want to compare two files so I wrote the following code:
while($line1 = ){
while($line2 = ){
next if $line1 > $line2;
last if $line1 < $line2;
}
next;
}
My question here is that when the outer loop comes…

lolibility
- 2,187
- 6
- 25
- 45
0
votes
2 answers
How to read every four lines of .gz file in parallel with OpenMP?
test.fa.gz file contains multiple 4 lines as blow:
@HWI-ST298:420:B08APABXX:3:1101:1244:2212 1:N:0:TCATTC
GGCAAGGCACTTACTTTACAGCTAAAGAAGTGCAGC
+
@@@FDFFDFHCFDACGHC<

user1465767
- 41
- 1
- 6
0
votes
1 answer
System Calls - How to find a character within a string, if he character exists
I'm extremelly new to System Calls. I think I can use Index but not quite sure how to implemented. Let's say I want to look up on a file with data for every ":" and '>"
for example I have a myfile.txt with the following:
hello: this is a testing
…

NewLearner
- 213
- 2
- 6
- 16
-1
votes
1 answer
storing failes: binmode() on closed filehandle $out at ... print() on closed filehandle $out
see the update at the end of the intail posting
well i am a bit confued i have to admit...;-) being a novice perl-friend the perl-code allway looks a bit abracadaba....
i need to have some thumbnails from websites but i tried to use wget - but…

zero
- 1,003
- 3
- 20
- 42
-1
votes
1 answer
Php : Separate file content into different files
I have this file
1 + 3 = 4
0 + 0 = 0
1 + 2 = 3
1 / 1 = 1
2 * 3 = 6
I want to separate the (firstNum, secondNum, operationUsed(+,-,*,/), and result) into 4 different files

eksoo
- 81
- 1
- 6
-1
votes
1 answer
Problem with file handling part of C++ assignment
This function is supposed to take care of updating the file after calling the respective functions for depositing or withdrawing from a user account. But it fails to do just that. I've checked as much as I can and all the other functions seem to be…
-1
votes
1 answer
Use path as inputile instead of file name?
I am trying to use the path as input instead of a file name.
I tried
from pathlib import path
file_to open = Path (source/input*/in.txt)
with open ('file_to_open', 'r') as f_i:
for line in f_i:
I could not be able to open the path. Please…

perkins royal
- 1
- 7
-1
votes
1 answer
Perl script unable to open a file in write mode
As I am new to Perl can anyone help me out with this code.
I want to write contents to a file named redirectedOutputFile (create one such file if it does not exist).
perlRedirect.pl
$var = @ARGV[0];
print "Hello!\n";
$filepath =…

shreyaskar
- 375
- 1
- 3
- 14
-1
votes
2 answers
File::Tail::Select what is the @pending behaviour
foreach my $subfile(glob "*:*")
{
print "opening $subfile\n";
push(@files,File::Tail->new(name=>"$subfile",debug=>$debug));
}
while (1)
{
($nfound,$timeleft,@pending)=…

T_y
- 1
-1
votes
1 answer
File::Tail::select mean?
This is great it is work, but has one part I not understand :
print $_->{"input"}." (".localtime(time).") ".$_-> read;
What does it print? If I modify it to:
print "$_";
There are some error. Why?
#!/usr/local/bin/perl
use File::Tail;
chdir(…

T_y
- 89
- 1
- 3
- 8
-1
votes
1 answer
IO - documentation - question
both IO::Handle and IO::File are included in core package called IO. They are object interface for perl I/O subsystem. If you use IO::Handle/IO::File in any script, open will also return objects of this class.
(bvr's comment from…

sid_com
- 24,137
- 26
- 96
- 187