Download src/php/php-src/ext/ftp/tests/ftp_append.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 927 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ftp/tests/ftp_append.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ftp/tests/ftp_append.phpt
-
curl -L -o ftp_append.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ftp/tests/ftp_append.phpt
927 Bytes
| --TEST-- | |
| ftp_append() create new file and append something | |
| --EXTENSIONS-- | |
| ftp | |
| pcntl | |
| --FILE-- | |
| require 'server.inc'; | |
| $ftp = ftp_connect('127.0.0.1', $port); | |
| if (!$ftp) die("Couldn't connect to the server"); | |
| var_dump(ftp_login($ftp, 'user', 'pass')); | |
| $fooPath = __DIR__ . '/ftp_append_foo'; | |
| file_put_contents($fooPath, 'foo'); | |
| var_dump(ftp_append($ftp, 'ftp_append_foobar', $fooPath, FTP_BINARY)); | |
| $barPath = __DIR__ . '/ftp_append_bar'; | |
| file_put_contents($barPath, 'bar'); | |
| var_dump(ftp_append($ftp, 'ftp_append_foobar', $barPath, FTP_BINARY)); | |
| $fooBarPath = __DIR__ . '/ftp_append_foobar'; | |
| var_dump(file_get_contents($fooBarPath)); | |
| ftp_close($ftp); | |
| --CLEAN-- | |
| $fooPath = __DIR__ . '/ftp_append_foo'; | |
| unlink($fooPath); | |
| $barPath = __DIR__ . '/ftp_append_bar'; | |
| unlink($barPath); | |
| $fooBarPath = __DIR__ . '/ftp_append_foobar'; | |
| unlink($fooBarPath); | |
| --EXPECT-- | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| string(6) "foobar" | |