Make asynchronous call in PHP using PHP socket and custom User agent string

Recently I wrote about async calls in PHP. In the provided example from w-shadow.com there is one thing missing – User agent string. Changing User agent string to something unique is handy, when analyzing log file. You can see, if someone is messing with your hidden asynchronous PHP script. Here is an example, that uses …

Windows API Function SetFileAttributes silently ignores compressed and encrypted attributes

When you call Windows API function SetFileAttributes, it ignores FILE_ATTRIBUTE_COMPRESSED (0x800) and FILE_ATTRIBUTE_ENCRYPTED (0x4000) values passed as parameters. Most likely it is implemented in this way, because you can pass value from GetFileAttributes, FindFirstFile and FindNextFile without modifications to SetFileAttributes. This applies to Windows XP, Windows Server 2003 / 2008, Windows Vista.