ftp_nb_get_large.phpt 874 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Testing ftp_nb_fget can handle large files incl. resume
  3. --SKIPIF--
  4. <?php
  5. require 'skipif.inc';
  6. if (2147483647 == PHP_INT_MAX) {
  7. die('skip ot supported on this system');
  8. }
  9. if (disk_free_space(__DIR__) < 10*1024*1024*1024) {
  10. die('not enough disk space');
  11. }
  12. ?>
  13. --FILE--
  14. <?php
  15. require 'server.inc';
  16. $ftp = ftp_connect('127.0.0.1', $port);
  17. ftp_login($ftp, 'user', 'pass');
  18. if (!$ftp) die("Couldn't connect to the server");
  19. $local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt";
  20. touch($local_file);
  21. ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119);
  22. $fp = fopen($local_file, 'r');
  23. fseek($fp, 5368709119);
  24. var_dump(fread($fp, 1));
  25. var_dump(filesize($local_file));
  26. fclose($fp);
  27. ?>
  28. --CLEAN--
  29. <?php
  30. @unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt");
  31. ?>
  32. --EXPECT--
  33. string(1) "X"
  34. int(5368709120)