我想查看一下基本网络服务的源代码 FTP,Telnet,rlogin等。
任何人都可以告诉我在哪里可以获得它们。 顺便说一句,它不是我没有google它,例如搜索ftp,给出了这么多ftp变种的列表,但我很想看看Ubuntu附带的ftp客户端/服务器。
由于
答案 0 :(得分:2)
http://archive.ubuntu.com/ubuntu/pool/main/n/netkit-ftp/netkit-ftp_0.17.orig.tar.gz
如果它是您感兴趣的特定Ubuntu源代码,那很容易。转到包裹说明页面,例如http://packages.ubuntu.com/lucid/net/,按照相关链接,在包描述中查找指向.orig.tar.gz文件的链接。 Ubuntu以这种方式打包所有工作。
答案 1 :(得分:1)
源代码链接位于http://packages.ubuntu.com/
上的包页顶部答案 2 :(得分:-4)
这是代码
<?php
$ftp_server = “www.yoursite.com”;
$ftp_user_name = “username”;
$ftp_user_pass = “password”;
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if ((!$conn_id) || (!$login_result)) {
echo “FTP connection has failed!”;
echo “Attempted to connect to $ftp_server for user $ftp_user_name”;
exit;
} else {
echo “Connected to $ftp_server, for user $ftp_user_name”;
}
$dir = “”;
function filecollect($dir,$filelist) {
global $conn_id; //Get our ftp
$files = ftp_nlist($conn_id,$dir); //get files in directory
foreach ($files as $file) {
//$isfile = ftp_size($conn_id, $file);
if($isfile == “-1″) { //Is a file or directory?
$filelist = filecollect($dir.’/’.$file,$filelist,$num); //If a folder, do a filecollect on it
}
else {
$filelist[(count($filelist)+1)] = $file; //If not, add it as a file to the file list
}
}
return $filelist;
}
$filelist = filecollect($dir,$filelist);
echo “<pre>”;
print_r($filelist);
echo “</pre>”;
$dir=”yoursite.com”;
$filelist = filecollect($dir,$filelist);
echo “<pre>”;
print_r($filelist);
echo “</pre>”;
$new=explode(“/”,$filelist['73']);
$myFile =$new[1];
//echo “$myFile”;
$fh = fopen($myFile, ‘r’) or die(“can’t open file”);
//$fh = fopen($myFile, ‘w’) or die(“can’t open file”);
//$stringData = “Ashwani\n”;
//fwrite($fh, $stringData);
$the = fread($fh, 1000000);
fclose($fh);
?>
<form action=”" method=”post” enctype=”multipart/form-data” name=”form”><table width=”100%” border=”0″>
<tr>
<td><? echo $new[1]; ?></td>
<td><textarea name=”textarea” cols=”40″ rows=”40″><? echo $the; ?></textarea></td>
</tr>
</table>
</form>