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
0
votes
2 answers

Closing Java FileHandler when quitting a routine that runs as a service

I have a little routine that schedules a timer like that: timer.schedule(new myRoutine(), 1000, 60000); In the run() method of myRoutine a logger is opened and a FileHandler is attached to it: FileHandler fh = new…
Prefect73
  • 321
  • 3
  • 14
0
votes
2 answers

open docx file from onedrive for business with some webapp but not word online

this is not a question but kind of a request. I have tried to find right place to post (asked to msdn forum, partnership support, ...) but failed. why microsoft gives me this difficulty? can't place a total official support page? anyway, this is…
Junho Cha
  • 35
  • 6
0
votes
3 answers

PDF file sometime being displayed as garbage

I am having a user who is reporting that files are being displayed as raw data in his browser. He uses Internet Explorer. The files are being served via a .ashx handler file and it has been working until. This is the relevant part of my .ashx…
Muleskinner
  • 14,150
  • 19
  • 58
  • 79
0
votes
1 answer

How to set XMLFormatter with FileHandler to only write raw message

I'm using java FileHandler to append to a file, and occasionally rotate it. The data consists of JSON strings, one on each line. The file is consumed by another process, and I want the FileHandler to only write the JSON string I pass into the…
worker1138
  • 2,071
  • 5
  • 29
  • 36
0
votes
1 answer

Android Logging: Folder not created in /storage/emulated/0

I'm trying to create a log file in my android application using java.util.logging but the folder is not getting created. I don't understand the problem. Below is the code public class MainActivity extends AppCompatActivity { private static…
Ekta
  • 338
  • 2
  • 9
  • 26
0
votes
0 answers

EMFILE, too many open file

[INFO] system - { codeblock: 'catch copy image', error: { [Error: EMFILE, too many open files './uploads/54f911bad366ed/document/document_559dfb750f15617.png'] errno: 20, code: 'EMFILE', path:…
Josie
  • 60
  • 6
0
votes
2 answers

IOError: [Errno 2] No such file or directory, even though the file is existed

I am trying to figure out why I am having such error. I ran the same exact code for another directory which contains four files and it is working just fine. This time with using another directory I am getting error this error IOError: [Errno 2] No…
0
votes
2 answers

Java logging to File: Alternative persistence scheme

New to Java. I would like to use the logger, but with a different file persistence scheme. Instead of rotating files and overriding, I would like the logs to be created in a time based file system hierarchy, where log files contain logs of the past…
user4212919
  • 305
  • 1
  • 2
  • 7
0
votes
1 answer

FileHandler causing IOException at FileKey

I call a java class from PLSQL Dev. My Logger.java calls the FileHandler with a string "C:\Logs\mylog.TXT" fileHndlr = new FileHandler(logFileName, false); and the result is: Exception in thread "Root Thread" java.lang.Error: java.io.IOException:…
szokea
  • 1
  • 3
0
votes
1 answer

Call method when java.util.logging.Filehandler changes output file

In my java-server I use the java.util.logging framework to log the state of my program. To avoid a too large log file I use this Filehandler constructor: //import java.util.logging.FileHandler; //import java.util.logging.Logger; FileHandler fileLog…
morgelo
  • 136
  • 15
0
votes
1 answer

Java: check if logger is empty so it does not creat a txt file

I have a class named Logg. That i use for send every exception or other warnings. before it creates a file, I want to check if it has anything to write to the file. So it does not create a empty txt file. code: package ast; /** *Handles logging …
0
votes
0 answers

How to delete a log file based on path or FileHandler in java?

Here's my code that creates a log file: // Start a log file FileHandler fh; String logFileName = ""; try { SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy_HHmmss"); logFileName = "folder/mylog_" +…
goe
  • 1,153
  • 2
  • 12
  • 24
0
votes
1 answer

File Handler doesn't start working until i have a file created

I have a loggers.config file that specifies a custom file handler to format log messages to a file. The handler wont work unless a create a default file with the specified file pattern. It then creates a new file with a 0 appended to it as specified…
Daniel Devlin
  • 95
  • 1
  • 11
0
votes
3 answers

gvim windows netrw filehandler html elinks configuration

I'm using gvim 7.3, MS-Windows 32-bit GUI version with OLE support I'm attempting to configure the netrw filehandler to open locally saved .html files in with the elinks browser, rather than the firefox browser. The help file for netrw refers to a…
user2962912
  • 69
  • 1
  • 6
0
votes
1 answer

Read from file and and use explode function

I need help. I have a file that include numbers: 105 5001 5450 1548 5158 7875 8785 2404 5410 1548 0 0 Now should read from this file then save number of a line and apart that (where it has space between numbers.)and save it on Variable. For…
user3994255