What is the difference between NTFS Junction Points and Symbolic Links?

Symbolic links have more functionality, while junctions almost seem to be a legacy feature because of their limitations, but the security implications of these limitations are specifically why a junction might be preferred over a symbolic link. Remote targeting makes symbolic links more functional, but also raises their security profile, while junctions are safer because … Read more

How do the UNIX commands mv and rm work with open files?

Unix filesystems use reference counting and a two-layer architecture for finding files. The filename refers to something called an inode, for information node or index node. The inode stores (a pointer to) the file contents as well as some metadata, such as the file’s type (ordinary, directory, device, etc.) and who owns it. Multiple filenames … Read more

Enable native NTFS symbolic links for Cygwin

⸻⸻  Short answer  ⸻⸻ Define environment variable: CYGWIN=winsymlinks:nativestrict As pointed out by mwm you may also have to go to the settings or to run bash as Administrator. See the Notes section. ⸻⸻  Long answer  ⸻⸻ Default Cygwin symlinks are just regular files By default Cygwin creates text files as workaround for Windows symlink flaw. … Read more

How to read and modify NTFS Alternate Data Streams using .NET [closed]

Here is a version for C# using System.Runtime.InteropServices; class Program { static void Main(string[] args) { var mainStream = NativeMethods.CreateFileW( “testfile”, NativeConstants.GENERIC_WRITE, NativeConstants.FILE_SHARE_WRITE, IntPtr.Zero, NativeConstants.OPEN_ALWAYS, 0, IntPtr.Zero); var stream = NativeMethods.CreateFileW( “testfile:stream”, NativeConstants.GENERIC_WRITE, NativeConstants.FILE_SHARE_WRITE, IntPtr.Zero, NativeConstants.OPEN_ALWAYS, 0, IntPtr.Zero); } } public partial class NativeMethods { /// Return Type: HANDLE->void* ///lpFileName: LPCWSTR->WCHAR* ///dwDesiredAccess: DWORD->unsigned int ///dwShareMode: … Read more

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

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-us/library/aa365247.aspx for full details.

tech