filesystem

NTFS Filesystem Time

I tested this on windows xp. If I do Create a file. Write to the file. Close the file.(Then, the file's LastWriteTime is changed) But if I do Create a file. Set LastFileTime of the file. Examine the time by calling GetFileTime (Then, the file's LastWriteTime is changed) Sleep 20 seconds. Write to the file. Sleep 20 seconds. Close ...

Dealing with file properties C#

I want to get the file size of any given file using the C#, and I need to show it in GB, MB, KB and bytes if possible ... and for audio (mp3) files, I need to get the duration of the file ... ...

Windows: File rename and directory iteration clash

I'm using boost::filesystem to rename a file like this: boost::filesystem::rename(tmpFileName, targetFile); tmpFileName / targetFile are of type boost::filsystem::path. While doing this, I iterate over the directory using this code in another thread: directory_iterator end_itr; for (directory_iterator itr(dirInfoPath); itr != end_i...

Developing a file storage web application

I'm currently developing a web application whose primary user function is uploading and downloading of files. The files will be stored on the hard disk (no cloud storage yet). Taking into consideration the possibilities of gigabytes of data and a large number of files, do I need to organize files into sub folders to account for the fet...

How to avoid the buffer mechanism from FileSystem

Take VirtualBox's virtual disk as example:if VirtualBox didn't avoid the buffer mechanism from FileSystem in host os,the FileSystem in guest os would move data from memory to meory. In fact ,I want to write a filesystem in user space(put all directorys and files in a single big file). But if I use c api such fread and fwrite ,the FileS...

How can shared folders using VMware Workstation 7 access hidden filenames?

For our build machines, we run VMware Workstation. We have source code checked out in a shared folder (shared from the host using VMware). In the builds we do svn operations like update etc. This worked fine until updating to Workstation 7. Now we get errors like this: svn: In directory 'E:\bitten\winxpbitten\bitten\j5-trunk\j5\Sites\C...

How to get full path of current directory in Python?

I want get the full directory path of current file. I tried os.path.abspath(__file__) But it return the full path including the file. C:\\python27\\test.py Where as I just need C:\\python27\\ ...

NTFS structure and error analysis

This may sound like a serverfault question, but it isn't. It is about data formats of NTFS. Here goes. I have a corrupt disk drive. It's flashes in RAID, but it doesn't matter. Various corruption modes occur occasionally on these disks. The resulting error, which I have at hand at the moment, is detectable by chkdsk. I need to know, fr...

Windows temp directory details (Java)

I'm writing a program that needs a generic temp folder. I'm trying to find details about the Windows Temp folders. There are two paths that I know about - In each user directory under AppData\Local\Temp\ This may change depending Windows version? In the system folder under Temp\ (C:\Windows\Temp) I'm wondering exactly what Windows do...

Getting 'attachments' out of MySQL BLOB fields, and into the filesystem

I have a standard LAMP server, and currently there is a way to attach/upload PDF's, or JPEG's with an inventory record. I designed this system way back in 1999/2000, and it has of course grown fairly large in size. The table that holds the attachments is approaching 10GB, which has made working with the data somewhat slow (especially w...

Android: Write to /sys/ directory

I'm developing an application that is not intended to be released as a standard app. It'll be run on a single rooted device. I require the ability to write to a file in the /sys/ directory. The file in question is owned by root and has -rw-rw-rw- permissions. I am aware that there may be restrictions on the VM my code runs within that ...

Cocoa: detect unmountable volume

I folks, I am developing a small app which should be able to unmount volumes. Currently, I am using the following code to determine whether a volume is unmountable or not: BOOL isRemovable, isWritable, isUnmountable; NSString *description, *type; BOOL succ = [ws getFileSystemInfoForPath:[itemInfo objectForKey:@"path"] ...

How can one download the contents of an HTML5 web database to the client?

I am looking for a way to save the contents of an HTML5 web database to a local file for persistence and for loading back into the web application. I'm using Firefox 3.6.8 with the HTML5 features to use a local web database. I can upload a file and read it's contents but am unable to find an elegant way to save the contents of the databa...

Placing a byte at a very specific address on a hard disk, can it be done? (using c++ for example)

This might sound silly, but I'd like to know how to do the following. I've created a .txt file. The content of the .txt file is the word "hi" without the quotes. So the .txt file contains 2 characters. When opening the .txt file in a hex-editor one sees 2 hexadecimal pairs, namely "68" and "69": Offset 00000000 68 69 hi What I want t...

Duplicate GetAccessRules, FileSystemAccessRule entries

Hi, I'm getting a duplicate FileSystemAccessRule from this code below: C:\inetpub\wwwroot\AspInfo\Account BUILTIN\IIS_IUSRS : Allow : ReadAndExecute, Synchronize BUILTIN\IIS_IUSRS : Allow : -1610612736 NT SERVICE\TrustedInstaller : Allow : FullControl NT SERVICE\TrustedInstaller : Allow : 268435456 and I can't work out what or why it ...

modify content of xml file from published code

I am trying to modify an xml file from my aspx code. The file is in another directory from my project like in D:\folder\file.xml When publishing my code and running it I am receiving an error as not to be able to access this directory, access in denied. Which user account shall I add to this folder in security option to be able to modify...

Loading a picture file Image.FromFile VS FileStream

I must admit that I never understood what are the streams are all about- I always thought it's an internet thing. But now I run into a code that used a stream to load a file localy and I wonder if there is advantage for using a stream over... well the way I always loaded files: private void loadingfromStream() { DirectoryInfo dirInfo...

When do we should use a scatter/gather(vectored) IO?

Windows file system supports scatter/gather IO.(Of course, other platform does) But I don't know when do I use the IO mechanism. Could you explain me a proper case? And what benefit can we get from using the I/O mechanism?(Just a little IO request?) ...

Format hard drive with javascript

A while ago a colleague of mine said something astonishing to me: he said that one can format a hard drive using javascript! I just replied 'no, this is impossible'. He seemed to be very confident however, although he also mentioned that this is possible for windows only... Since then I can't give up thinking on it, but I haven't found a...

What do "\\.\", "\??\", "\\?\", "\\" mean?

What I know is \\.\ It is used when we open a device's symbolic link in user mode \??\ It is used when we open a device in kernel mode \\?\ long file name \\ UNC path. But I want to know more detail. Could you explain more certainly about these prefixs. ...