Changes between Initial Version and Version 1 of Ticket #54582, comment 2
- Timestamp:
- 12/05/2021 11:15:05 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54582, comment 2
initial v1 13 13 touch( $lower_case_filename ); 14 14 15 $mixed_case_stat = stat( $mixed_case_filename ); 16 $lower_case_stat = stat( $lower_case_filename ); 17 18 // Compare the Inodes returned by the 2 stat calls: if their the same, then filesystem is case-insensitive. 19 $filesystem_case_insensitive = $mixed_case_stat['ino'] === $lower_case_stat['ino']; 15 // Compare the Inodes: if they are the same, then filesystem is case-insensitive. 16 $filesystem_case_insensitive = fileinode( $mixed_case_filename ) === fileinode( $lower_case_filename ); 20 17 21 18 unlink( $mixed_case_filename ); … … 28 25 }}} 29 26 30 It seems to work as expected, but needs some error checking added (e.g., test that `tempnam()` and ` stat()` succeed). Not yet sure what to do if those fail, i.e., what should it return in that case.27 It seems to work as expected, but needs some error checking added (e.g., test that `tempnam()` and `fileinode()` succeed). Not yet sure what to do if those fail, i.e., what should it return in that case. 31 28 32 29 My thought with comparing the `Inodes` is that is more foolproof than doing something like a `glob()` and counting the number of results returned...but I could certainly overthinking it. Would love feedback on that.