filesystem

Concurrency handling using the filesystem VS an RDMBS (MySQL)

I'm building an English web dictionary where users can type in words and get definitions. I thought about this for a while and since the data is 100% static and I was only to retrieve one word at a time I was better off using the filesystem (ext3) as the database system instead of opting to use MySQL to store definitions. I figured there...

Windows disk partition gap

Windows XP Disk Defragmenter report shows a constant gap in disk usage on a number of disk partitions on my system. I'm not referring to the little transitory gaps that occur. In disk D below, the gap in question is the one under the word "defragmentation". In disk P below, the gap is the one under "usage before def" the but a bigge...

server.mappath("."), server.mappath("~"), server.mappath(@"\"), server.mappath("/"). What is the difference?

Can anyone explain the difference between Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"\") and Server.MapPath("/")? ...

Java - get the newest file in a directory?

Does anybody have a snippet of Java that can return the newest file in a directory (or knowledge of a library that simplifies this sort of thing)? ...

Browser application & local file system access

I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation and server via HTTP(S). I am aware of security-related limitations in browser-based applications. However, there are some techniques that "...

Scripting.FileSystemObject.FileExists always returns false

I'm attempting to check that a file exists before including it with Server.Execute in Classic ASP. While FileExists() returns False, Server.Execute successfully executes the file. Both calls use the exact same file path. Why does this happen and how can I work around it? ...

how to watch FS for change

I'm doing a project in a course at my university on distributed systems. I'm planning on creating something similar to Dropbox ( getdropbox.com ), but with some sort of non-centralized peer-to-peer twist to it. For this i need some method of detecting change in a directory structure. How do you think Dropbox do this? Their implementation...

Distributed filesystem sanity check

Hi, I'm in need of a distributed file system that must scale to very large sizes (about 100TB realistic max). Filesizes are mostly in the 10-1500KB range, though some files may peak at about 250MB. I very much like the thought of systems like GFS with built-in redundancy for backup which would - statistically - render file loss a thing...

How do i check if a file is a regular file in C++?

How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile(). DIR *dp; struct dirent *dirp; while ((dirp = readdir(dp)) != NULL) { if ( isFile(dirp)) { cout << "IS A FILE!" << endl; i++; } I've tried comparing dirp->d_type with (unsigned char)0x8, but it seems not portable...

Windows system cache and huge files.

Hi, i have a problem with windows system cache. Sample code: int main(int argc, char* argv[]) { HANDLE file_ = INVALID_HANDLE_VALUE; file_ = CreateFile( "test_file.txt", GENERIC_WRITE, FILE_SHARE_READ, 0, ...

Best practices for file system dependencies in unit/integration tests

I just started writing tests for a lot of code. There's a bunch of classes with dependencies to the file system, that is they read CSV files, read/write configuration files and so on. Currently the test files are stored in the test directory of the project (it's a Maven2 project) but for several reasons this directory doesn't always exi...

Best way to determine if two path reference to same file in C#

In the upcoming Java7, there is a new API to check if two file object are same file reference. Are there similar API provided in the .NET framework? I've search it over MSDN but nothing enlighten me. I want it simple but I don't want to compare by filename which will cause problems with hard/symbolic links and different style of path....

Alternative to Filename Extensions?

Since reading this question, I'm wondering: What would be the Right ThingTM to do to associate a UNIX file (ie, blob of data) with a file type? We have file extensions (DOS), data/resource forks (Apple) and ... err, file extensions and file(1) (UNIX), and MIME types (html et. al.). Given all your griefs about handling files of various...

How do I determine whether the filesystem is case-sensitive in .net?

Does .net have a way to determine whether the local filesystem is case-sensitive? ...

Why would subversion timeout when I try to commit changes to a directory?

When attempting to commit file in the jsunit directory in my working-copy, I waited a really long time and got an error like: svn: OPTIONS request failed on '/svn_repo/OSB_Project/trunk/OSB/test/web/jsunit' svn: timed out waiting for server Why would the server hang at this point? Running SuSE 10.3 in a VirtualBox where I keep my Sub...

How do I unlock a folder/file under Linux

Today I had the problem that I couldn't delete a folder because "it was busy". How can I find out which application to blame for that or can I just delete it with brute force? ...

Is there a way in Java to determine if a path is valid without attempting to create a file?

I need to determine if a user-supplied String is a valid file path (i.e. if createNewFile() will succeed or throw an Exception) but i don't want to bloat the file system with useless files created just for validation purposes, so is there a way to determine if the String i have is a valid file path without attempting to create the file? ...

Prefered method to map a remote filesystem in windows ?

For a current project, I need to allow users to access their files remotely from Windows. I'm looking for a solution with an explorer integration (using Shell Namespace Extensions). I first try using WebDAV and the built-in client in Windows but the client is not of equal quality in all Windows version and adding SSL and/or authenticati...

Non-file FileSystems?

I've been thinking on this for a while now (you know, that dangerous thing programmers tend to do) and I've been wondering, is the method of storing data that we're so accustomed to really all that efficient? The trouble with answering this question is that I really don't have anything to compare it to, since it's the only thing I've eve...

Win32API function to join directories ?

Does the Win32 API have a function for joining two paths? I can't find it, so I thought I'd ask before rolling my own. ...