filesystem

Deduplicating identical files using hard links

I have a couple of identical files stored in more than one place on my hard disk. I figure I can save a lot of disk space by hard-linking them to point to the same file. I am a little worried about possibly disastrous side effects. I guess it does not affect permissions, as those are stored in the respective directories, just like the f...

Synchronizing filesystem and cached data on program startup

I have a program that needs to retrieve some data about a set of files (that is, a directory and all files within it and sub directories of certain types). The data is (very) expensive to calculate, so rather than traversing the filesystem and calculating it on program startup, I keep a cache of the data in a SQLite database and use a Fi...

Determining directory equivalence (Windows)

Say I have two directory paths: C:\Shares\Apple\Orange and \\MACHINENAME\Apple\Orange Is there a way to (programmatically) determine if they refer to the same directory? In general, can I determine whether two directory references are equivalent without comparing paths? ...

How to determine how much free space on a drive in Qt?

I'm using Qt and want a platform-independent way of getting the available free disk space. I know in Linux I use statfs and in Windows I use GetDiskFreeSpaceEx(). I know boost has a way (boost::filesystem::space(Path const & p);). I don't want those. I'm in Qt and would like to do it in a Qt-friendly way. I looked at QDir, QFile, ...

Download, store, view and manage PDF File

Hi, Can I download a PDF file and shows it without use UIWebView? I need to show PDF and get full control of its show... Also, Can I download and strore PDF into filesystem app? Thx ...

Unix filesystem look up

How to get the list of all the files and folders in the root dir including sub-folders and their files. ...

How do I "normalize" a pathname using boost::filesystem?

We are using boost::filesystem in our application. I have a 'full' path that is constructed by concatenating several paths together: #include <boost/filesystem/operations.hpp> #include <iostream>   namespace bf = boost::filesystem; int main() { bf::path root("c:\\some\\deep\\application\\folder"); bf::path subdir("..\\conf...

.NET How to compare two Strings that represent filenames ignoring case correctly

Given that (at least on NTFS) the filesystem on Windows is case insensitive, I would like to compare String fileA to String fileB as such: fileA.Equals(fileB, StringComparison.CurrentCultureIgnoreCase) The question then becomes which culture I should use, does the default current (ui?) culture suffice? I can't seem to find any BCL met...

Can boost filesystem change the read-only attribute of a file?

Is there a way to change the attribute of a file from read-only to read-write using the boost filesystem library? If not, what is the next-best way to do this on Windows (using Microsoft's C++)? ...

Fastest way to list all files + dirs in .NET

I know how to use the DirectoryInfo.GetFiles(), but I do not think this is the fastest way to go. These "FileInfo" objects seem a little bit big... Why do I need it? Well, I tried to achieve my search tool with WDS, but I give up. The OleDB connection is horrible, strange errors without any explanation. So what I am going to do is: Reb...

How to provide security to files and folders through C#.NET in FAT File system

I have created a folder lock in C#.NET which is working good on NTFS file system But its not working on FAT file system. please tell which dll/class/namespace should i use to get Lock files and folder on FAT file system through C#.NET sample code which is working with NTFS (below code is to unlock file/folder) FileInfo info = new FileI...

How can I find all of the distinct file extensions in a folder hierarchy?

On a Linux machine I would like to traverse a folder hierarchy and get a list of all of the distinct file extensions within it. What would be the best way to achieve this from a shell? ...

How do I copy files and folders using boost and Visual Studio 2005?

I'm trying to use boost::filesystem to copy files and folders (just like a standard copy a folder and paste it in windows explorer). Although I've been to the boost::filesystem documentation, I still don't really know how to go about doing this. Do you have to recursively go though each directory (creating it) and find each file copyi...

Eclipse and Windows 7

I have reinstalled my computer with Windows 7, and Eclipse 3.5.1 (Galileo). The weird thing is that I can not see any files that Eclipse produces. I can not find the workspace, can not find the files from the SVN after check out. It seems like Windows 7 can not read the files produced by Eclipse ... wierd What could be the reason for...

Are there any naming conventions when creating your own file suffix?

I'm working on a little game and figured I'd pack images and other resources into my own files to keep the directories neat. Then I thought, is there any convention to what I should call my file, or can I simply call it what ever without anyone ever caring? There's probably not a lot of strong opinions about this rather innocent subject,...

Is it possible to make a process on a server act like a filesystem to interact with FTP?

What I want to do is run a process on my server that acts like an FTP server. So people can upload things through "FTP" but really it's a program I'm running that lets me put information about that file in a database and not really put the files where they say they're going. E.g. Website Templates. A user of my service wants to put up t...

saving just the deltas over a network/internet

Is there currently a filesystem agnostic way to have a file in two locations on a network, change one copy, and have just the changed bits (or more likely blocks) synced to the other copy? It would be awesome to have media files in the cloud, allow another service to read them and me to edit them with their web app, and then only have t...

Special characters in OSX filename ? (Python os.rename)

I am trying to rename some files automatically on OSX with a python script. But I fail to work with special characters like forward slash etc.: oldname = "/test" newname = "/test(1\/10)" os.rename(oldname, newname) I think I do have an encoding problem. But different tries with re.escape or using UTF-8 unicode encodings havent been su...

Speeding up file system access?

My app scans part of a file system, and my users reported it was very slow when they were scanning a network drive. Testing my code, I identified the bottleneck: the methods File.isFile(), File.isDirectory(), and File.isHidden(), which are all calling fs.getBooleanAttributes(File f). This method appears to be very slow on Windows netwo...

Limiting the File System Usage Programmatically in Linux

I was assigned to write a system call for Linux kernel, which oddly determines (and reduces) users´ maximum transfer amount per minute (for file operations). This system call will be called lim_fs_usage and will take a parameter for maximum number of bytes all users can access in a minute. For short, I am going to determine bandwidth of ...