Create an empty file in Node.js?

If you want to force the file to be empty then you want to use the ‘w’ flag instead: var fd = fs.openSync(filepath, ‘w’); That will truncate the file if it exists and create it if it doesn’t. Wrap it in an fs.closeSync call if you don’t need the file descriptor it returns. fs.closeSync(fs.openSync(filepath, ‘w’));

Is there a way in Java to determine if a path is valid without attempting to create a file?

Path class introduced in Java 7 adds new alternatives, like the following: /** * <pre> * Checks if a string is a valid path. * Null safe. * * Calling examples: * isValidPath(“c:/test”); //returns true * isValidPath(“c:/te:t”); //returns false * isValidPath(“c:/te?t”); //returns false * isValidPath(“c/te*t”); //returns false * isValidPath(“good.txt”); //returns true * isValidPath(“not|good.txt”); //returns false … Read more

What is the difference between VFAT and FAT32 file systems?

Copied from http://technet.microsoft.com/en-us/library/cc750354.aspx What’s FAT? FAT may sound like a strange name for a file system, but it’s actually an acronym for File Allocation Table. Introduced in 1981, FAT is ancient in computer terms. Because of its age, most operating systems, including Microsoft Windows NT®, Windows 98, the Macintosh OS, and some versions of UNIX, … Read more

What are `Zone.Identifier` files, and how do I prevent them from being created? [closed]

The text after the colon is an identifier for an “Alternate Data Stream”. ADS is used to store meta-information about the file. For example, the Zone identifier stores whether the file was downloaded from the internet. Some specific info about URL Security Zones, Zone.Identifier Stream Name See also Technet, Heysoft and this article about alternative … Read more