boostÔÚlinuxÏÂÈçºÎ±àÒ룿ÈçºÎ»ñÈ¡´ÅÅÌÁÐ±í£¿
·¢Ò»¸öÌù£¬¶þ¸öÎÊÌâ¸÷¶þÊ®·Ö
1.linuxʹÓÃbjam -sTOOLS=gcc installºó£¬µ«ÊÇÔÚ±àÒëÖîÈç libs/filesystem/example/simple_ls.cpp ʱ£º
g++ simple_ls.cpp -lboost_filesystem -o simple_lsʱ£¬²»ÄܱàÒëͨ¹ý£¬Ìáʾ£ºld return 1 exit status.Èç¹ûʹÓÿâÄØ£¿
ls /usr/local/libÏÂÊÇÓÐlibboost_filesystem.soµÈ¿â
2.filesystemÊǶÔÎļþ²Ù×÷µÄÒ»¸ö¿â£¬ÄÇôÈç¹ûÒª»ñµÃwindowsϵÄc:,d:,e:;linuxϵÄ/home,/usr,/binµÈÐÅÏ¢ÈçºÎ»ñÈ¡£¿
C/C++ code:
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/progress.hpp"
#include <iostream>
#include <string>
#include <exception>
#include <vector>
namespace fs = boost::filesystem;
const size_t GB = 1<<30;
int main( int argc, char* argv[] )
{
std::string path(" :");
std::cout << "Windows:\nÅÌ·û\t" << "×ܿռä\t\t" << "¿ÉÓÿռä\t" << std::endl;
for (char ch='a'; ch<='z'; ++ch){
path[0] = ch;
fs::path p(path);
try {
if (!fs::exists(p)) continue;
std::cout << path << '\t';
fs::space_info si = fs::space(p);
std::cout<< si.capacity * 1.0 / GB << "GB\t"
<< si.available * 1.0 / GB << "GB\t
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
Á½Ì¨»úÆ÷ÐͺÅÍêȫһÑù
ÏëÒª°Ñһ̨»úÆ÷µÄÄÚºËÅäÖÃÎļþ¿½±´¸øÁíÍâһ̨
RT
3Q
...
.config Òþ²ØµÄ ÔÚÄãÅäÖùýÄں˺ó¾ÍÉú³ÉÁË
lsÕý½â£¬ÔÚkernelÔ´Âë¶¥²ãĿ¼ÖÐÓиö.configÎļþ£¬ÅäÖ ......
СµÜ×î½üÐèÒªÒ»¸öÓÃsocket»ñÈ¡htmlÎĵµµÄ´úÂ룬µ«ÊÇÀÏÊDz»ÄÜ»ñÈ¡ÍêÕûµÄhtmlÔ´Âë¡£ÔÒò²»Ã÷£¬Íû¸ßÊÖÖ¸µã£¡
C/C++ code:
char *Http_GET(char *host,int port,char *data) //·¢ËÍGETÇëÇó
{
char response[2 ......
ÎʸöÎÊÌâ ½ñÌì·¢Ïֺܶà³ÌÐòËÀÔÚlinux ·þÎñ½øÖÐ
ÒѾËÀÁ˺öàÌìÁË¡£ÓÃcrontab ¶¼¶¨ÔÚ Á賿0µãÅÜ¡£
ÏëÖªµÀÈçºÎ²é¿´ ·þÎñÆ÷ÄÄ·½ÃæµÄ×ÊÔ´Ì«ÉÙµ¼Ö½ø³ÌËÀÔÚÀïÃæ£¿
³ÌÐò±¾ÉíÊÇ·ñ¾Í´æÔÚÎÊÌâ
ÒýÓÃ
ÎʸöÎÊÌâ ½ñÌ ......