Questions tagged [filehandle]

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.

407 questions
0
votes
2 answers

Declaring a Filehandle in Python

I need to do a try block on open but I want my variable to be available externally: inputFile = null #This is the line that I don't know how to write try: inputFile = open( sys.argv[0] ) except IOError as e: print "ERROR: Could not open " +…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
0
votes
1 answer

Writing to filehandle won't work with sleep

I was working on a script when I suddenly realized I couldn't write to a file. I've been able to get it down to this bit of code: use strict; use warnings; open(my $out, '>>', 'log.txt') or die "$!"; print $out "test"; while(1){ sleep 1; } I…
Gabs00
  • 1,869
  • 1
  • 13
  • 12
0
votes
2 answers

Convert this in Perl curl -v -H "AUTH_USER:$user" "$url" 1> "$tmpfile" 2> "$hdrfile"

I am trying to convert this shell command into perl I am using use WWW::Curl::Easy; I want to write the verbose in a different file and i want to get the URL content into a different file . Till now i have been able to curl the URL and add header to…
0
votes
4 answers

Please tell me how to find and replace particular word in a file using vb.net

i have created a template xml file witch contain some words like {contentname}. i need to replace such a tags with my values. please tell me how to search such a words and replace using filehandling in vb.net my xml templatefile is like this: