How to search through archived files with Perl
What is your preferred method for reading through the contents of zipped directories with Perl ? ...
What is your preferred method for reading through the contents of zipped directories with Perl ? ...
I'm writing a log file viewer for a web application and for that I want to paginate through the lines of the log file. The items in the file are line based with the newest item on the bottom. So I need a tail() method that can read n lines from the bottom and supports an offset. What I came up with looks like this: def tail(f, n, off...
I am having some problems reading from a file. I have two header files: a and b. b is derived from a,and c is derived from b. Now i want to open a text file. The whole format is like this: A john A johnee P 123 If the first charcter is 'a' and 'p' is also there, then print the second line, else print the first line. #i...
Is there a way to check if a file has been opened by ReWrite in Delphi? Code would go something like this: AssignFile(textfile, 'somefile.txt'); if not textFile.IsOpen then Rewrite(textFile); ...
I am using VB6 and the Win32 API to write data to a file, this functionality is for the export of data, therefore write performance to the disk is the key factor in my considerations. As such I am using the FILE_FLAG_NO_BUFFERING and FILE_FLAG_WRITE_THROUGH options when opening the file with a call to CreateFile. FILE_FLAG_NO_BUFFERING ...
I would like to write some data to a file in Ruby. What is the best way to do that? ...
I know the mantra is that the database is always the long pole in the tent anytime a page is being generated server-side. But there's also a good bit of file i/o going on on a web server. Scripted code is replete with include/require statements. Moreover, its typically a practice to store templated html outside the application in files ...
Because of the more tedious way of adding hosts to be monitored in Nagios (it requires defining a host object, as opposed to the previous program which only required the IP and hostname), I figured it'd be best to automate this, and it'd be a great time to learn Perl, because all I know at the moment is C/C++ and Java. The file I read...
I'm curious how to assess if there is any read- or write-activity for a specific harddrive at a given moment with .NET / C#. Second it would be interesting to assess the actual speed of access. Any ideas? ...
Hi, I'd like to invoke bash using a string as input. Something like: sh -l -c "./foo" I'd like to do this from Java. Unfortunately, when I try to invoke the command using getRuntime().exec, I get the following error: foo": -c: line 0: unexpected EOF while looking for matching `"' foo": -c: line 1: syntax error: unexp...
When running performance tests file system cache hit or miss can significantly influence test results. Therefore generally before running such tests used files are evicted from system cache. How to do that on Linux? Clarification: If possible, the solution should not require root privileges. ...
Is there a max length that a stream writer can write out to a file? Or is there a max length that WriteLine() can output? I am trying to write some data to a file but all of the data does not seem to make it. Thank you for the help ...
I got following problem my app open file in subdirectory of directory where it is executed, subdirectory is called sample and it contains files example.raf (example extension, non signigficant) background.gif example.raf contains relative path to background.gif (in this case only file name cause the files is in same directory as raf)...
Is there any performance comparison of System.IO.File.ReadAllxxx / WriteAllxxx methods vs StreamReader / StremWriter classes available on web. What you think is the best way(from a performance perspective) to read/write text files in .net 3.0? When I checked the MSDN page of System.IO.File class, in the sample code MS is using StreamRea...
I am trying to take a rather large CSV file and insert it into a MySQL database for referencing in a project. I would like to use the first line of the file to create the table using proper data types and not varchar for each column. The ultimate goal is to automate this process as I have several similar files but the each has different ...
Personally, I always forget this stuff. So I figured this is a useful thing to have as a reference. Read an ascii file into a string Write an ascii file from a string Read a binary file into something appropriate. If possible, store in a string, too. Write a binary file from something appropriate. If possible, write from a string, t...
Hi, I'd like to read whole content of a text file to a std::string object with c++. With Python, I can write: text = open("text.txt", "rt").read() It is very simple and elegance. I hate ugly stuff, so I'd like to know what is the most elegance way to read a text file with c++? Thanks. ...
Hello! I'm writing an editor for large archive files (see below) of 4GB+, in native&managed C++. For accessing the files, I'm using file mapping (see below) like any sane person. This is absolutely great for reading data, but a problem arises in actually editing the archive. File mapping does not allow resizing a file while it's being a...
How do I know which files and registry keys an application is trying to access? ...
Hi, I am testing an application that checks if a file exists across a network. In my testing, I am purposefully pulling the network plug so the file will not be found. The problem is this causes my app to go unresponsive for at least 15 seconds. I have used both the FileExists() and GetAttr() functions in VB6. Does anyone know how to...