fileinode_basic.phpt 762 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test fileinode() function: Basic functionality
  3. --FILE--
  4. <?php
  5. /*
  6. Prototype: int fileinode ( string $filename );
  7. Description: Returns the inode number of the file, or FALSE in case of an error.
  8. */
  9. echo "*** Testing fileinode() with file, directory ***\n";
  10. /* Getting inode of created file */
  11. $file_path = dirname(__FILE__);
  12. fopen("$file_path/inode.tmp", "w");
  13. print( fileinode("$file_path/inode.tmp") )."\n";
  14. /* Getting inode of current file */
  15. print( fileinode(__FILE__) )."\n";
  16. /* Getting inode of directories */
  17. print( fileinode(".") )."\n";
  18. print( fileinode("./..") )."\n";
  19. echo "\n*** Done ***";
  20. --CLEAN--
  21. <?php
  22. unlink (dirname(__FILE__)."/inode.tmp");
  23. ?>
  24. --EXPECTF--
  25. *** Testing fileinode() with file, directory ***
  26. %d
  27. %d
  28. %d
  29. %d
  30. *** Done ***