filesystem

How check if given string is legal (allowed) file name under Windows?

I want to include batch file rename functionality in my application. User can type destination filename pattern and (after replacing some wildcards in pattern) I need to check if it's going to be legal filename under Windows. I tried to use regular expression like [a-zA-Z0-9_]+ but it doesn't include many national-specific characters fro...

How do you iterate through every file/directory recursively in standard C++

How do you iterate through every file/directory recursively in standard C++ ...

Directory Modification Monitoring

I'm building a C# application that will monitor a specified directory for changes and additions and storing the information in a database. I would like to avoid checking each individual file for modifications, but I'm not sure if I can completely trust the file access time. What would be the best method to use for getting recently modi...

Directory listing in Python

How do I get a list of all files (and directories) in a given directory in Python? ...

How do I copy a file in python?

How do I copy a file in python? I couldn't find anything under os. ...

Is there a one-liner to read in a file to a string in C++?

I need a quick easy way to get a string from a file in standard C++. I can write my own, but just want to know if there is already a standard way, in C++. Equivalent of this if you know Cocoa: NSString *string = [NSString stringWithContentsOfFile:file]; ...

How to determine when copy finishes in VBScript?

Does anyone know of a method to determine when a file copy completes in VBScript? I'm using the following to copy: set sa = CreateObject("Shell.Application") set zip = sa.NameSpace(saveFile) set Fol = sa.NameSpace(folderToZip) zip.copyHere (Fol.items) ...

Last Modified of Folders

How does Windows determine the last modified date of a folder? ...

What would cause the current directory of an executing app to change?

I have a C# application that includes the following code: string file = "relativePath.txt"; //Time elapses... string contents = File.ReadAllText(file); This works fine, most of the time. The file is read relative to the directory that the app was started from. However, in testing, it has been found that if left alone for about 5 h...

PHP - How do I include a file over 2 directories back?

How do you include a file that is more than 2 directories back. I know you can use ../index.php to include a file that is 2 directories back, but how do you do it for 3 directories back? Does this make sense? I tried .../index.php but it isn't working. I have a file in /game/forum/files/index.php and it uses PHP include to include a fil...

HTML/Javascript app that runs on the filesystem, security issue

I'm putting together a little tool that some business people can run on their local filesystems, since we don't want to setup a host for it. Basically, its just HTML + Javascript (using jQuery) to pull some reports using REST from a 3rd party. The problem is, FF3 and IE don't allow the ajax call, I get: Access to restricted URI denied...

How to get notified when a drive letter becomes available

Is it possible to get notified (without polling, but via an event) when a drive letter becomes accessible. For example if you have an external hard drive that always appears as drive F - is it possible to have an event raised when that is connected and F becomes accessible? ...

How do you check if a folder is accessible over a network in c#

I need to know if a folder is accessible to other computers on the network, so the first part of this is checking if the folder is shared accross the network. As the folder I'm checking may be a sub-folder, I can't just iterate across shared folders on the computer to check if one of them points to my folder unless WMI allows me to chec...

Maintaining an index of a filesystem

I need to record in some kind of file, the specific time at which blocks are written to in a filesystem, over a number of physical disks (RAID). I intend to do this by periodically by interrogating the writing device to find out which block it is writing to at that specific time. At some later date it will be necessary to locate and r...

How do I create a sparse file programmatically, in C, on Mac OS X?

I'd like to create a sparse file such that all-zero blocks don't take up actual disk space until I write data to them. Is it possible? ...

What are the advantages of memory-mapped files?

I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: concurrency random access performance ease of use portability ...

How do I remove a folder from Windows Distributed File System?

We recently moved to a webfarm and setup dfs, only to find a beta application was creating files like there was no tomorrow. 1.2 million files were replicated across the farm, and since then we have prevented the application from creating new files, but every time we try to remove the files, it replaces them on each server because of rep...

How do you store uploaded files in a filesystem?

I'm trying to figure out the best way to store user uploaded files in a file system. The files range from personal files to wiki files. Of course, the DB will point to those files by someway which I have yet to figure out. Basic Requirements: Fairy Decent Security so People Can't Guess Filenames (Picture001.jpg, Picture002.jpg, Mu...

How to present credentials in order to open file?

How do I specify the username and password in order for my program to open a file for reading? The program that needs to access the file is running from an account that does not have read access to the folder the file is in. Program is written in C# and .NET 2, running under XP and file is on a Windows Server 2003 machine. ...

Using the file system to augment ram

I should preface this by saying I'm working on a pocket PC app and the data files live on sd cards. I have an app that has to create an array of size x. malloc is failing every time. I've got a 1 gig file on a 4 gig card. I've got 64 megs of onboard memory (ram/data/application/os) I can't process the data because the array I need ...