Create post-HADVAs expect files
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / file / fileperms_variation1.php
blobd2456d03597bd0cc21a4020ceeed9d7941b3d71e
1 <?hh
2 /* Prototype: int fileperms ( string $filename )
3 * Description: Returns the group ID of the file, or FALSE in case of an error.
4 */
6 /* Creating soft and hard links to a file and applying fileperms() on links */
7 <<__EntryPoint>> function main(): void {
8 fclose( fopen(__SystemLib\hphp_test_tmppath('fileperms_variation1.tmp'), "w") );
10 echo "*** Testing fileperms() with links ***\n";
11 /* With symlink */
12 symlink(
13 __SystemLib\hphp_test_tmppath('fileperms_variation1.tmp'),
14 __SystemLib\hphp_test_tmppath('fileperms_variation1_symlink.tmp')
16 var_dump( fileperms(__SystemLib\hphp_test_tmppath('fileperms_variation1_symlink.tmp')) ); //expected true
17 clearstatcache();
19 /* With hardlink */
20 link(
21 __SystemLib\hphp_test_tmppath('fileperms_variation1.tmp'),
22 __SystemLib\hphp_test_tmppath('fileperms_variation1_link.tmp')
24 var_dump( fileperms(__SystemLib\hphp_test_tmppath('fileperms_variation1_link.tmp')) ); // expected: true
25 clearstatcache();
27 echo "\n*** Done ***";
29 unlink(__SystemLib\hphp_test_tmppath('fileperms_variation1_symlink.tmp'));
30 unlink(__SystemLib\hphp_test_tmppath('fileperms_variation1_link.tmp'));
31 unlink(__SystemLib\hphp_test_tmppath('fileperms_variation1.tmp'));