File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,33 +15,28 @@ $testfile = "$dir/testfile.txt";
1515// Create a temporary file for valid access tests
1616file_put_contents ($ testfile , "hello " );
1717
18- // Invalid: negative mode
1918try {
2019 posix_access ($ testfile , -1 );
2120} catch (ValueError $ e ) {
2221 echo $ e ->getMessage (), "\n" ;
2322}
2423
25- // Invalid: mode with garbage bits
2624try {
2725 posix_access ($ testfile , 01000 ); // S_ISVTX bit (sticky)
2826} catch (ValueError $ e ) {
2927 echo $ e ->getMessage (), "\n" ;
3028}
3129
32- // Invalid: mode with unrelated high bits
3330try {
3431 posix_access ($ testfile , 02000 ); // S_ISGID bit
3532} catch (ValueError $ e ) {
3633 echo $ e ->getMessage (), "\n" ;
3734}
3835
39- // Valid: check read and write access
4036if (posix_access ($ testfile , POSIX_R_OK | POSIX_W_OK )) {
4137 echo "Read/write access OK \n" ;
4238}
4339
44- // Valid: check file existence
4540if (posix_access ($ testfile , POSIX_F_OK )) {
4641 echo "File exists OK \n" ;
4742}
You can’t perform that action at this time.
0 commit comments