files

From Shell: Delete all files with apostrophes

How do I delete all files in a folder that has an apostrophe? for example: Baird/'s Tunnel.jpg Bach/'s Birds.jpg This isn//'t good.png I would like all those files deleted but anything that doesn't have an apostrophe to remain intact, like: this is good.jpg donotdelete.png ...

Fastest way to store easily editable config data in PHP?

Hi, What is the fastest way to store config data in PHP so that it is easily changeable (via PHP)? First I thought about having config.php file, but I can't edit it on fly with PHP, at least not very simply? Then I thought about having XML files, but parsing them for each HTTP request is overwhelming. So, I thought about INI files, but ...

Android: good practices for organizing dirs and files on storage SD card?

Are there any guidelines where should my app store resource files downloaded from internet? ...

imagemagick unable to load remote images

Hi I have a php script, which downloads, rescales and stores an image using the following command: exec('convert -sample 100x100 http://someurl.com/pic.jpg images/somename.jpg'); It all worked fine until I put it on a different server (this one's gentoo, if that makes any difference. Apparently convert won't grab remote images, and i...

check what files are open in Python

I'm getting an error in a program that is supposed to run for a long time that too many files are open. Is there any way I can keep track of which files are open so I can print that list out occasionally and see where the problem is? ...

Problems with files on separate domain not loading for random periods of time

I have a separate domain name for static content such as images, js files, and css files. I load this static content on the main site from this other domain to double the amount of concurrent connections the browser makes to load the page faster. This seems to work and I haven't had any issues myself, but I've been getting e-mails from...

Responding to interactions with files in C#?

I want to write a program that will encrypt an entire folder and it's sub-folders, I have no problem doing this but I would like to make the entire encryption process rather transparent by letting a user double click it and have it open as if it weren't encrypted, say if it were a picture or a word document and it'd open in it's respecti...

can i call one js file from another . .

i have an asp.net mvc app and i am trying to move all of my javascript out into js files. right now i have one called sharedfunctions.js which is used all over the place. the issue is that if i move some code into a js file that is calling a method in the sharedfunctions.js file, it no longer seems to work. what is the best way to be ...

Python synchronised reading of sorted files

I have two groups of files that contain data in CSV format with a common key (Timestamp) - I need to walk through all the records chronologically. Group A: 'Environmental Data' Filenames are in format A_0001.csv, A_0002.csv, etc. Pre-sorted ascending Key is Timestamp, i.e.YYYY-MM-DD HH:MM:SS Contains environmental data in CSV/column...

Why does Perl just give me the last line in the file?

Hi, I have downloaded the following file: rawdata_2001.text and I have the following perl code: open TEXTFILE, "rawdata_2001.text"; while (<TEXTFILE>) { print; } This however only prints the last line in the file. Any ideas why? Any feedback would be greatly appreciated. ...

lseek() returning 0 when followed by new open()

I have the following bit of code (it's "example" code, so nothing fancy): #include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <unistd.h> int main() { char buffer[9]; int fp = open("test.txt", O_RDONLY); if (fp != -1) // If file opened successfully { off_t offset = lseek(fp,...

PHP: Create new XML file and write data to it?

I am needing to create a new xml file and write that to my server. So, I am looking for the best way to create a new xml file, write some base nodes to it, save it. Then open it again and write more data. I have been using file_put_contents() to save the file. But, to create a new one and write some base nodes I am not sure of the be...

Get files in a folder

In my MVC application I have the following paths; /content/images/full /content/images/thumbs How would I, in my c# controller, get a list of all the files within my thumbs folder? Edit Is Server.MapPath still the best way? I have this now DirectoryInfo di = new DirectoryInfo(Server.MapPath("/content/images/thumbs") ); but feel it...

Where can I modify (at least find the files) completions in Vim?

I turned on completion in Vim: autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTa...

How to let a user securely access files on the server

I'm working on a web app that allows scientists to submit to a high performance computing cluster through a web interface. The users fill in some data about their experiment, upload some files and the web app takes care of the rest. At the end of the computation the users need to be able to access their resultant files. They are around...

rejoin files after split cli linux

I have a file which was split into 600 meg pieces how do I join then back to original? command was used: split -b 600m image.iso ...

Does gVim store all its files in the Program Files/vim directory?

Does gVim store files (specially preferences) in other directories rather than Program Files (for instance in %apps% like emacs)? If not, can I carry gVim in a USB frashdrive? (There's a portable version of Vim, but since it doesn't store anything in other folders I can't figure out it needs a portable version). ...

Recursively list files in Java

How do I recursively list all files under a directory in Java? Does the framework provide any utility? I saw a lot of hacky implementations. But none from the framework or nio ...

Why is LRU better than FIFO?

Why is Least Recently Used better than FIFO in relation to page files? ...

rename many files automatic one time - ddmmyyyy.file to yyyymmdd.file

Hello I have 1500 files that are named with an incorrectly dateformat. I would like to rename them. Are there a tool that can do that? Otherwise a piece of php code. File names are: ddmmyyyy.xls (e.g. 15012010 for 15.th Jan 2010) and I would like: yyyymmdd.xls (e.g. 20100115.xls) Any clue on how this can be done for 1500 files in one...