files

shell script to traverse files recursively

I need some assistance in creating a shell script to run a specific command (any) on each file in a folder, as well as recursively dive into sub-directories. I'm not sure how to start. a point in the right direction would suffice. Thank you. ...

mod_rewrite for friendly urls unexpected behaviour

I have Apache and I have this in the .htaccess file: RewriteEngine on RewriteRule ^myhome myhome.php because I want to redirect /myhome/ to /myhome.php. It works, but it behaves unusually. When I type in myurl.com/myhome, it redirects to myurl.com/myhome.php correctly, but when I try myurl.com/myhome/ with the slash at the end, it red...

Sorting+merging lines of multiple files according to a timestamp

Hey everyone. I have multiple text files that represent logging entries which I need to parse later on. Each of the files is up to 1M in size and I have approximately 10 files. Each line has the following format: Timestamp\tData I have to merge all files and sort the entries by the timestamp value. There is no guarantee that the entri...

Creating read only text files with python.

Hi all, Is it possible to create read only files in python which can not be changed later and in which users can not change its attribute from read-only to normal file? Please suggest. Thanks in advance. ...

Linux File Logs

I need to view a log of files that have been opened, surely there are logs stored for this, but I have not been able to find them in the /var/log/ directory. Thanks, Dave ...

Listing available files and directories in Matlab

I would like to list available directories and text files in specific directories recursively in Matlab command window (and ultimately in an m-file). I know commands like ls are available, but I would like to know the text files available in a string or vector before I recursively read each text file in the following file system structur...

Looping through files with perl

Okay I have 2 files. One file is data that is updated every 10 minutes while the second is data that was previously used. What I am trying to do is take one line from the new file and loop through each line of the second file and see if it matches one. If it does I dont want to use it, but if there is no match than I want to add it to a ...

Checking when a file was last modified in C# on Windows OS

Hi, I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file. Thanks in advance ...

how to search the computer for files and folders.

i need a way to search the computer for files like Windows Explorer. i want my program to search lets say hard drive c:. i need it to search C:\ for folders and files (just the ones you could see in c:\ then if the user clicks on a file on the list like the folder test (C:\test) it would search test and let the user see what files/folder...

How to shuffle the lines in a file without reading the whole file in advance?

What's a good algorithm to shuffle the lines in a file without reading the whole file in advance? I guess it would look something like this: Start reading the file line by line from the beginning, storing the line at each point and decide if you want to print one of the lines stored so far (and then remove from storage) or do nothing an...

Where should Map put temporary files when running under Hadoop

Hi, I am running Hadoop 0.20.1 under SLES 10 (SUSE). My Map task takes a file and generates a few more, I then generate my results from these files. I would like to know where I should place these files, so that performance is good and there are no collisions. If Hadoop can delete the directory automatically - that would be nice. Right...

How to determine the type of a file by content?

If I have a file without an extension, how can I determine what type of file it is (music, video, text, etc.)? Are there any hints to determine a file's extension depending on its character components? ...

How do I test modules/scripts that output/modify files?

I have a couple of modules (DZP::Catalyst and DZP::OurPkgVersion) both of their purposes involve writing out files to the disk. I'm not sure how to test them, are there any good strategies for testing files written out to disk? any place I could go to read up on it? ...

How to count number of non-derived files in an Eclipse project.

So, how to count number of files in an Eclipse project, with the specific requirement that derived resources should not be counted. (otherwise one could easily use unix command line tools to calculate that) Linked and virtual resources need not be considered, although, bonus points if you do. ...

Get remote file size via HTTP without downloading said file.

Any way to get the size of a (remote, http) file without actually downloading it? All other similar questions seem to revolve around grabbing the expectedContentLength from the NSURLResponse object in didReceiveResponse: but I don't want to download the file, I just want to know how big it is. ...

copy multiple files in python

How to copy all the files in one directory to another in python. I have the source path and the destination path in a string. ...

file extension query

I have a text file c1.data....Im trying to open it but it is not getting open up? what software do I need for it? ...

"ffmpeg": java.io.IOException: error=24, Too many open files

Hi, I am working with ffmpeg to generate previews, but I get this error in the middle of the execution of my program: "ffmpeg": java.io.IOException: error=24, Too many open files Does anybody know how to solve or how to avoid it?? I add the piece of code where I use ffmpeg: for (int j = 0; j < temp.length; j++) { ...

Using php to create a zip file

Hi Using the Create ZIP File PHP class I have the following line of code $createZip->get_files_from_folder('blog/wp-content/themes/', 'themes/'); Am I right in thinking that this code gets the files and sub directories from 'blog/wp-content/themes/' creates a new folder entitled 'themes', and then puts these files and sub directories...

how to determine if a variable exists in another python file

I have two python files. From python file #1, I want to check to see if there is a certain global variable defined in python file #2. What is the best way to do this? ...