filesystem

Fast (lowlevel) method to recursively process files in folders

My application indexes contents of all hard drives on end users computers. I am using Directory.GetFiles and Directory.GetDirectories to recursively process the whole folder structure. I am indexing only a few selected file types (up to 10 filetypes). I am seeing in profiler that most of the indexing time is spent in enumerating files a...

Filesysteminfo get the Date of creation

hello, i have some documents that has been copied in a folder.(example with word) when i use filesysteminfo.CreationTime i get the date when i copied it. (right click on the document, (last to select) "eigenschaften") but when i go into the document and select Datei --> Eigenschaften --> "Date of Creation" i get the "right CreationTime...

Why imageboard scripts do not use database?

I was very surprised when downloaded two imageboard php scripts. There is no connection to database, threads and posts are listed as files and folders. Is this way faster than standard mysql database connection or there is another reason? ...

Copy a dir from a webserver to a mapped networkdrive

Hi All, For a PHP project I'm working on, focussing on data homogenity, a certain directory structure can be managed. After a user completes a process creating an object (I won't bother you guys with all the project details;)) this directory structure should be copied to a mapped network drive. Since the users might have the networkdriv...

Fastest way to determine a stale Samba mount on Linux

What is the best(fastest) way to determine if a Samba mount point is dead on Linux? I need to do it in C. System calls like statfs(), statvfs() block for 30-40 sec when called on a stale mount, and they don't even return an error in this case. stat() seems to fail faster then others (about 10 sec) and returns an error. Mount point may g...

Unbelievable strange file creation time problem

Hi, I have a very strange problem indeed! I wonder if the problem is in the framework, OS or maybe it's just me, misunderstanding things... I have a file, which might be created a long time ago, I use the file, and then I want to archive it, by changing it's name. Then I want to create a new file, with the same name as the old file had...

How can I download and extract a zipped CSV and get the contents of CSV file into a MySQL table.

I'm trying to write a PHP script to download a zip file from a web server that contains a single CSV file and then load the contents of the extracted CSV file into an existing MySQL database table. $targetFile = 'data-' . md5(microtime()) . '.zip'; $url = 'http://www.address.com/data.zip'; $out = fopen('/path/to/zip/save/folder/' . $ta...

Is there a way to check what's in the cache for Windows OS's?

I would like to see what is in the cache at any given time. Is there a way to check what's in the cache? ...

rewriting the same file in rapid succession?

I am working on an app that will keep a running index of work in accomplished. I could write once at the end of a work session, but I don't want to risk losing data if something blows up. Therefore, I rewrite to disk (XML) every time a new entry or a correction is made by the user. private void WriteIndexFile() { XmlDocument Index...

How do i escape invalid characters in filenames on multiple FS

How do i escape invalid characters in filenames? I ask this question once before and wrote up a class with the solution. Now i would like to extend it. My site will be able to detect what OS the user is on. So base on that i either 1) Want to escape based on the FS/OS the user is on or 2) Escape it so it works on all filesystems. What c...

CMS - Save pictures in database, What is the proper structure?

I currently build a CMS system that need to save a lot of pictures per article. I have a lot of questions :-) I need to show the pictures in a few sizes, with or without watermark. In addition I need to have the original picture too, for archive and admin purpose. What that I think to do right now is to save the pictures in the database...

`virtual' files

Sometimes I'm downloading big files which have been split into chunks, say, a 1GByte file into ten chunks with 100MByte each.  Currently, I have to concatenate all files into a new file to be able to access it as a whole.  I now wonder whether it is possible to group these chunks into a virtual file (similar to virtual file systems), avo...

python get a filtered list of files in directory

Hi, I am trying to get a list of files in a directory using python, but I do not want a list of ALL the files. What I essentially want is the ability to do something like the following but using python and not executing ls. ls 145592*.jpg If there is no built-in method for this, I am currently thinking of writing a for loop to itera...

php & filesystem +setUID/permissions ... i just don't get it!

i have to admit, i never really completely got the *nix filesystem permission model. oh, the rwxrwxrwx stuff isn't too complicated, but i get confused easily when programs create new files and how i can handle them. my current problem is the mixture of a (closed source) java-applet that does file uploads over ftp and php (it's on a ded...

Cross-platform solution for mounting a custom filesystem

I have a need to make my data part of the machine's file system. In windows it seems I have 3 options: Eldos' "Callback File System" (http://www.eldos.com/cbfs/) Dokan (dokan-dev.net) Pismo File Mount (http://www.pismotechnic.com/pfm/) Of these 3 option 1 (Eldos) is by far the best looking option. But ideally I would like to get a...

Magento; private/public filesystem layer

I want to split up the magento package in a private and public web directory. E.g. the private directory is reuseable on multiple projects, its just the app. private/ app, downloader, includes, lib, pkginfo, var public/ 404, js, media, report, skin + current root files (index.php etc.) Im setting this up in SVN where just one cop...

Storing frequently accessed data in a file rather than MySQL

I'm working on a PHP content management system and, in testing, have noticed that quite a few of the system's MySQL tables are queried on almost every page but are very rarely written to. What I'm wondering is will this start to weigh heavily on the database as site traffic increases, and how can I solve/prevent this? My initial thought...

Where in the filesystem do I store app's data files?

I need to store some data files for my blackberry app. These are usually small png files that I download and store locally for performance reasons. Also I need to store an xml file locally. My question is where are these files supposed to be saved on a blackberry? Is there such a thing as an application's home folder or settings folder ...

Weird problem with input encoding in IPython

Hello! I'm running python 2.6 with latest IPython on Windows XP SP3, and I have two questions. First one of my problems is, when under IPython, I cannot input Unicode strings directly, and, as a result, cannot open files with non-latin names. Let me demonstrate. Under usual python this works: >>> sys.getdefaultencoding() 'ascii' >>> s...

WinForms TreeView recursive directory listing?

I want to make a treeview that shows all folders on the system, and only shows music files, such as .mp3 .aiff .wav etc. I remember reading that I need to use a recursive function or something along those lines. ...