ntfs

C++/Win32: How to wait for a pending delete to complete

落花浮王杯 提交于 2019-11-26 12:41:19
问题 Solved: Workable solution: sbi\'s answer Explanation for what really happens: Hans\'s answer Explanation for why OpenFile doesn\'t pass through \"DELETE PENDING\": Benjamin\'s answer The Problem: Our software is in large part an interpreter engine for a proprietary scripting language. That scripting language has the ability to create a file, process it, and then delete the file. These are all separate operations, and no file handles are kept open in between these operations. (I.e. during the

What encoding are filenames in NTFS stored as?

柔情痞子 提交于 2019-11-26 10:34:02
I'm just getting started on some programming to handle filenames with non-english names on a WinXP system. I've done some recommended reading on unicode and I think I get the basic idea, but some parts are still not very clear to me. Specifically, what encoding (UTF-8, UTF-16LE/BE) are the file names (not the content, but the actual name of the file) stored in NTFS? Is it possible to open any file using fopen(), which takes a char*, or do I have no choice but to use wfopen(), which uses a wchar_t*, and presumably takes a UTF-16 string? I tried manually feeding in a UTF-8 encoded string to

NTFS Alternate Data Streams - .NET [closed]

淺唱寂寞╮ 提交于 2019-11-26 10:23:10
How would I create/ delete/ read/ write/ NTFS alternate data streams from .NET? If there is no native .NET support, which Win32 API's would I use? Also, how would I use them, as I don't think this is documented? Not in .NET: http://support.microsoft.com/kb/105763 #include <windows.h> #include <stdio.h> void main( ) { HANDLE hFile, hStream; DWORD dwRet; hFile = CreateFile( "testfile", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, 0, NULL ); if( hFile == INVALID_HANDLE_VALUE ) printf( "Cannot open testfile\n" ); else WriteFile( hFile, "This is testfile", 16, &dwRet, NULL ); hStream =

Enable native NTFS symbolic links for Cygwin

跟風遠走 提交于 2019-11-26 08:58:58
问题 Recent NTFS and Windows implement symlinks: NTFS junction point can be used as directory symlink since NTFS 3.0 (Windows 2000) using linkd or junction tools. NTFS symbolic link can also be used as symlink (for both file and directory) since Windows Vista using mklink tool. But on Cygwin 1.7 (installed on Windows 7), ln -s creates a text file. on Cygwin: $ ln -s -v target mylink `mylink\' -> `target\' on MinGW (or your favorite editor): $ cat mylink !<symlink>ÿþt a r g e t Is it possible to

How can I detect only deleted, changed, and created files on a volume?

非 Y 不嫁゛ 提交于 2019-11-26 03:39:37
问题 I need to know if there is an easy way of detecting only the files that were deleted, modified or created on an NTFS volume. I have written a program for offsite backup in C++. After the first backup, I check the archive bit of each file to see if there was any change made, and back up only the files that were changed. Also, it backs up from the VSS snapshot in order to prevent file locks. This seems to work fine on most file systems, but for some with lots of files and directories, this

What encoding are filenames in NTFS stored as?

二次信任 提交于 2019-11-26 02:10:33
问题 I\'m just getting started on some programming to handle filenames with non-english names on a WinXP system. I\'ve done some recommended reading on unicode and I think I get the basic idea, but some parts are still not very clear to me. Specifically, what encoding (UTF-8, UTF-16LE/BE) are the file names (not the content, but the actual name of the file) stored in NTFS? Is it possible to open any file using fopen(), which takes a char*, or do I have no choice but to use wfopen(), which uses a

NTFS Alternate Data Streams - .NET [closed]

限于喜欢 提交于 2019-11-26 01:58:34
问题 How would I create/ delete/ read/ write/ NTFS alternate data streams from .NET? If there is no native .NET support, which Win32 API\'s would I use? Also, how would I use them, as I don\'t think this is documented? 回答1: Not in .NET: http://support.microsoft.com/kb/105763 #include <windows.h> #include <stdio.h> void main( ) { HANDLE hFile, hStream; DWORD dwRet; hFile = CreateFile( "testfile", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, 0, NULL ); if( hFile == INVALID_HANDLE_VALUE )

NTFS performance and large volumes of files and directories

寵の児 提交于 2019-11-26 00:35:51
问题 How does Windows with NTFS perform with large volumes of files and directories? Is there any guidance around limits of files or directories you can place in a single directory before you run into performance problems or other issues? E.g. is having a folder with 100,000 folders inside of it an OK thing to do? 回答1: Here's some advice from someone with an environment where we have folders containing tens of millions of files. A folder stores the index information (links to child files & child

Maximum filename length in NTFS (Windows XP and Windows Vista)?

 ̄綄美尐妖づ 提交于 2019-11-26 00:19:20
问题 I\'m designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista? 回答1: Individual components of a filename (i.e. each subdirectory along the path, and the final filename) are limited to 255 characters, and the total path length is limited to approximately 32,000 characters. However, on Windows, you can't exceed MAX_PATH value (259 characters for files, 248 for folders). See http://msdn.microsoft.com/en

出现VMware虚拟机磁盘丢失的情况,使用这种解决方式实在是太有必要了

僤鯓⒐⒋嵵緔 提交于 2019-11-25 21:58:25
VMware虚拟机设备信息: 1、VMware虚拟机(数量:40-50组;占用空间:1.8TB) 2、VMware虚拟机——ESX SERVER共享一台IBM DS4100存储 VMware虚拟机故障描述: 工作人员在使用过程当中,由于vc里报告虚拟磁盘丢失,通过ssh到ESX中执行fdisk -l查看磁盘,storage已经无分区表。经过重启所有设备后,ESX SERVER均无法连接到DS4100所在的STORAGE。 通过对管理员的咨询了解到,在该存储网络里曾连接一台windows 2003服务器。 VMware虚拟机故障分析: 由此我们可推测,有可能是那台windows 2003通过对storage的独享操作导致了vmfs卷损坏。 1、以整个存储做分析发现分区表清0,有55aa有效结束标志,有硬盘ID标志。 2、从前向后查看,发现一个NTFS卷,且无任何数据。我们通过对这个NTFS卷的BITMAP分析,得知大小约为1.8T(全部空间),3G左右位置占用部分空间,0.9T附近占用部分空间,但总占用空间不超过100M。 3、针对VMFS卷进行分析,发现在原1.8TB的磁盘里有2组VMFS分区,第2组是对第一组的extend,第一组约1.5T,第二组约300GB,因NTFS分区并未写数据到第二个VMFS分区里(最后一个扇区的DBR备份没有覆盖有用数据)