filesystems

How to permanently delete file so that it becomes unrecoverable?

If I want my application (written in .NET) to delete a file such that it can not be recovered by disk recovery tool. What are my options? One that I can think of is that I open it up in write mode, overwrite all of it with some random data and it would make the file unrecoverable. Is there any other way? ...

What is the equivalent of getfsstat() on Linux?

Question says it all. I want C function call that returns the list the mounted filesystems along with associated information such as filesystem type. ...

Copy nested folders contents to one folder recursively (terminal)

I have a Wordpress upload folder that is structured using subfolders for months. wolfr2:uploads wolfr$ tree . . |-- 2007 | |-- 08 | | |-- beautifulkatamari.jpg | | |-- beautifulkatamari.thumbnail.jpg | | |-- beetle.jpg | | |-- beetle.thumbnail.jpg How do I use terminal to copy all the images recursively into another ...

How to make a Ruby string safe for a filesystem?

I have user entries as filenames. Of course this is not a good idea, so I want to drop everything except [a-z], [A-Z], [0-9], _ and -. For instance: my§document$is°° very&interesting___thisIs%nice445.doc.pdf should become my_document_is_____very_interesting___thisIs_nice445_doc.pdf and then ideally my_document_is_very_interest...

LVM snapshot of mounted filesystem

I'd like to make a snapshot of a live filesystem in Linux, preferably using LVM. I'd like not to unmount it because I've got lots of files opened (my most common scenario is that I've got a busy desktop with lots of programs). I understand that because of kernel buffers and general filesystem activity, data on disk might be in some more...

Binary files and cross platform compatability

I have written a C++ library that saves my data (a collection of custom structs etc) into a binary file. I currently use (i.e. CREATE and CONSUME) the files locally, on my Windows (XP) machine. For simplicity, lets think of the library in two parts: a WRITER (Creates the files) and a READER or CONSUMER (simply reads data from the files)....

How does one reclaim zeroed blocks of a sparse file?

Consider a sparse file with 1s written to a portion of the file. I want to reclaim the actual space on disk for these 1s as I no longer need that portion of the sparse file. The portion of the file containing these 1s should become a "hole" as it was before the 1s were themselves written. To do this, I cleared the region to 0s. This d...

access files in documents folder of application of iphone

HEllo, I have a situation here, I have an app , in this app I save some files to documents folder. Now I want to export these files or view these files from mac. Suggest some way for this. Thanx in advance ...

Exception when setting ACL

Trying to delete an existing file and write a new on network share, Get the following exception.. [4804] System.UnauthorizedAccessException: Attempted to perform an unauthorized operation. [4804] at System.Security.AccessControl.Win32.GetSecurityInfo(ResourceType resourceType, String name, SafeHandle handle, AccessControlSections a...

unauthorized operation when setting ACL on a remote file /directory

Exact duplicate of: http://stackoverflow.com/posts/2035107 Trying file delete and save operation on a remote location. When run as a console App, it works fine but fails when called from XP_CMDSHELL (SQL server) Here is the exception when run from XP_CMDShell [4804] System.UnauthorizedAccessException: Attempted to perform an unauthori...

Eclipse IDE; Open in current window / instance?

I've been using Eclipse for about a week now and I'm loving it.. great software for the 'price'. :P However, I'm having a few issues getting started. The most annoying, so far, has been opening files from outside of Eclipse, and having them set to open w/ Eclipse. When I open a file from the file-explorer or an external application (Win...

Intelligent file copy algorithm (os independent)

Hi, I'm trying to create, a fast and somewhat intelligent file copy algorithm (in c# but platform independent). My goals: I don't want to use any platform specific code (no pinvokes or anything) I'd like to take advantage of multiple cores but this seems stupid since doing simultaneous reads/writes would seem slower right? (correct ...

Storing large amounts of data: DB or File System?

Hello, Let's say my application creates, stores and retrieves a very large amount of entries (tens of millions). Each entry has variable number of different data (for example, some entries have only a few bytes such as ID/title, while some may have megabytes of supplementary data). Basic structure of each entry is same and is in XML for...

Why do inode numbers start from 1 and not 0?

The C language convention counts array indices from 0. Why do inode numbers start from 1 and not 0? If inode 0 is reserved is for some special use, then what is the significance of inode 0? ...

How to find duplicate files with same name but in different case that exist in same directory in Linux?

How can I return a list of files that are named duplicates i.e. have same name but in different case that exist in the same directory? I don't care about the contents of the files. I just need to know the location and name of any files that have a duplicate of the same name. Example duplicates: /www/images/taxi.jpg /www/images/Taxi.jp...

Directory to array with PHP

Whats the most efficient way of turning the filenames in a directory into an array of strings? Thanks. ...

Turn directory into Zip with PHP

How would I turn a directory into a zip file with PHP? Thanks. ...

How can we find the number of blocks occupied by a file from userspace

How can we find the number of blocks occupied by a file from userspace ? Is there a command to do so or we need to access the inode structure and then fetch the information. I have searched a lot on the internet but could not find a valid answer. Can you please let me know Thanks. ...

How to open a file from browser by using asp.net c# code.

From Service method return me: String FileName, Byte[] FileData, string FileType( includes: doc, pdf, tif, tiff, gif, jpg, jpeg, png, bmp, wpd) How can I generate a file based on filetype and show it to user in browser? Download to user is ok for me ...

Programmatically Update Date Stamp of ASPX file

When adding new DB records to a ListView, I want to update the date/time stamp of the containing ASPX page for SEO purposes. Is this possible and how might I go about it? UPDATE: I found Touch for Windows, bu would still prefer any kind of clever hack just to do this programmatically: http://www.softpedia.com/get/System/File-Managemen...