Questions tagged [filehandler]

File handlers are mechanisms which provide abstraction over primitive file operations.

File handlers are modules (e.g. classes) which wrap primitive file operations (e.g. read, write) and file system operations (e.g. unlink, move, file watching) in helpful abstractions for specific usage scenarios.

For example, a file handler implemented as a class in opens a file in the format, reads each entry, and populates a list of row objects. In this case, the file handler has wrapped the open and read calls so the the caller need only know the name of the file.

Questions relating to the development of custom file handlers should include this tag. Additionally, questions which involve the use of standard or third-party file handlers may also include this tag.

See also:

147 questions
1
vote
1 answer

ASHX handler throwing value cannot be null error

I wanted to display a list of files in a specific folder as hyperlinks, and when the user click on the link, it will open the respective file to prompt the user to download or view but there is a constant error saying: {"Value cannot be…
Ariel Seah
  • 55
  • 5
1
vote
3 answers

How can get a filehandle for a Perl program's output?

I have an encrypted file X1, I have a Perl program P1 that decrypts the X1. I am parsing the decrypted file using a Perl program p2. X1--P1(decrypter) --> X2(plain text file) --p2(parser) --> parse output My parser is based on XML::Parser. It can…
Ram
  • 3,034
  • 11
  • 38
  • 46
1
vote
1 answer

FileHandler.limit java 7 not working

I have problem with java.util.logging.FileHandler.limit property as file size exceeded the limit size here are used properties in my application java.util.logging.FileHandler.pattern = ATMChannelAdapter%u.log java.util.logging.FileHandler.limit =…
1
vote
3 answers

Difference between ProcessBuilder and FileHandler

Can any one please explain difference between ProcessBuilder and FileHandler, which one should be used in which situation. For example if we want to redirect the output of a command to a text file say "logfile.txt", ProcessBuilder takes few seconds…
user3364490
  • 113
  • 2
  • 10
1
vote
2 answers

How to write separate log file for each instance of a class?

I am using java.util.logging for logging my program, the problem is that I need to create separate log file for each instance of class test case. For example, I have three test case objects, and in the end I get three log files, but: Test Case #3…
mrk2
  • 797
  • 3
  • 9
  • 20
1
vote
1 answer

create a directory with filehandler

I used java.util.logging to create two logfiles. Here's how it looks like. Handler fh = new FileHandler("%h/AntonGUI_Tester/Logfiles/"+logTime+".html"); fh.setFormatter(new HTMLTableFormatter()); …
1
vote
1 answer

How to test if STDIN has something to read (Perl on Windows)

I have encountered a problem in Perl. To test if the STDIN file handler has something to read immediately, I would like to program like this. while(1) { my ($l); if (TestCanRead(STDIN)) { $l = ; …
1
vote
1 answer

How to write util.logger in thread safe execution?

I have MyLogger class which contains: public class MyLogger { private final static Logger logger = Logger.getLogger(MyLogger.class.getName()); private static FileHandler fileHandler; private static String loggerFileName; public…
milind_db
  • 1,274
  • 5
  • 34
  • 56
1
vote
4 answers

how to ignore exit status from shell command in perl script

I have a following code, where i use a command which is used as input for file open. when my command $cmd gives non-zero exit status my script exits. i want it to still continue and do rest of the things in the script $cmd = 'ps -u psharma'; open(…
1
vote
2 answers

Perl, How can I use piping to cat multiple files into the same filehandler?

I've been trying to assign multiple files to a single file-handle. And from there process the entire filehandle to look for a certain pattern and then write that to FIN_RESULTS. Linux exp files my/dir1/RESULTS my/dir2/RESULTS etc. Here was my…
user1539348
  • 513
  • 1
  • 7
  • 20
1
vote
2 answers

java.util.logging.FileHandler and multithreading

The FileHandler class from java.util.logging implements some sort of locking mechanism for the file it is writing to. However i found that there a .lck files lying around in the filesystem after an application is finished. Is there a way to…
Matthias
  • 3,458
  • 4
  • 27
  • 46
1
vote
2 answers

logger and FileHandler in java

I want to print date and time in file not in the Screen this is my code: String fileName = NameEnter.getText(); Logger logger = Logger.getLogger("puzzleNumberGame.securityScreen"); FileHandler fh = new…
imalak
  • 11
  • 1
  • 1
  • 3
0
votes
3 answers

Java FileHandler disable log rotation

I am trying to disable log rotation, for file handler using, FileHandler fh = new FileHandler ( "path" + "run.log", 1000000, 1, false); What i want is one log, created for each run i do not want rotation or backing up of the old file, but using…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
0
votes
1 answer

How to only edit specific bytes of byte of a file instead of rewriting the whole file

I wanted to create a single file database for storing bytes which emulates the way our filesystem works on a hard drive such that I am able to edit specific bytes (changed or saved by the user) while writing to the database instead of reading the…
0
votes
1 answer

How to handle activation through files in WinUI 3 (Packaged)?

I want to define a filetype to open in my app and have already gotten this far: I added this to my Package.appxmanifest inside the Application tag:
LightJack05
  • 119
  • 5