Try the Baidu cloud client on Linux

Source: Internet
Author: User
Tags posix

I use Linux is startos5.1, blog is i in http://vb2005xu.iteye.com/blog/2119240

My local GCC version is

wrote [email protected]:~/softken$ gcc-v
Use built-in specs.
collect_gcc=gcc
Collect_lto_wrapper=/usr/lib/gcc/i686-pc-linux-gnu/4.6.3/lto-wrapper
Target: I686-pc-linux-gnu
Configured as:.. /configure--prefix=/usr--sysconfdir=/etc--libdir=/usr/lib--localstatedir=/var--infodir=/usr/share/info--mandir =/usr/share/man--enable-shared--libexecdir=/usr/lib--enable-threads=posix--enable-__cxa_atexit--enable-clocale =gnu--enable-languages=c,c++,fortran,lto,objc,obj-c++--with-system-zlib--enable-__cxa_atexit-- Enable-libstdcxx-time--enable-gnu-unique-object--enable-linker-build-id--with-ppl--ENABLE-CLOOG-BACKEND=ISL-- Enable-lto--enable-gold--enable-ld=default--enable-plugin--with-plugin-ld=ld.gold--with-linker-hash-style=gnu- -enable-checking=release--disable-bootstrap
Threading Model: POSIX
GCC version 4.6.3 (gcc for Startos)

Baidu Cloud has a Linux client version, the current seems to be a very simple prototype code, but has been able to use the normal,

Https://github.com/loujiayu/Baiduyun

The installation steps are as follows

Wrote Dependencies

Need following libraries:

Boost (boost filesystem)
Json-c (HTTPS://GITHUB.COM/JSON-C/JSON-C)
Openssl
CMake
Libcurl
Installation

$ CD Baiduyun
$ mkdir Build
$ CD Build
$ cmake..
$ make

During my local installation, I installed the Boost library and the Json-c library, and told me I couldn't find Jsonc's so file when I was using cmake, and so on:

Writes the lack of a dynamic connection library. So--cannot Open Shared object file:no such file or directory

There are 3 main ways of summarizing this:
1. Use ln to link the required so file to the/usr/lib or/lib two default directories below
Ln-s/where/you/install/lib/*.so/usr/lib
sudo ldconfig


2. Modify Ld_library_path

Export Ld_library_path=/where/you/install/lib: $LD _library_path
sudo ldconfig


3. Modify the/etc/ld.so.conf and then refresh


Vim/etc/ld.so.conf
Add/where/you/install/lib

sudo ldconfig

Here I check that the file does exist under/usr/local/lib, so the ldconfig is executed after sudo and then cmake can generate makefile file normally.

Then run make when the following error-std=gnu++11 unrecognized, this option should be added after GCC 4.8, so the full list of search, the next replacement, replaced by-std=c++0x

Another problem is that the statement #include <fstream> header is missing in the src/filesystem.cc header

For these bugs, see my ISSUE:HTTPS://GITHUB.COM/LOUJIAYU/BAIDUYUN/ISSUES/1

After make, the following files are generated Baiduyun

This is the generated program file, you can run it, the first time you run it using the-a parameter to obtain an authorization code, he will print a URL, and in the current directory to create a new directory named Mybaidu, you use the browser to open the URL and the resulting authorization code entered into the terminal input box, The carriage return is authorized, and after success, a. Baiduyun hidden file is created in the Mybaidu directory, where the authorized token information is placed

Use the-h parameter to view supported options, currently supported

wrote [email protected]:~/softken/yunbaidu$./baiduyun-h
Usage:baiduyun [option]
Options
-a Authenicate:authenticate your account with access token
-D download:download Files from/apps/ldrive
-U upload:upload files from./baidu_yun
-S Synchronise:detect files need to being downloaded or uploaded and do it
-H HELP:HELP Message

When you use the-d parameter, you do create a directory called Baidu_yun, which corresponds to my application data in your Baidu cloud->ldrive

Then upload the downloaded files will be placed here, for example, you send a local file to Baidu Cloud, only need

wrote [email protected]:~/softken/yunbaidu$ ls baidu_yun/
Kenvim.tar.gz Vim-note.txt
[Email protected]:~/softken/yunbaidu$./baiduyun-u kenvim.tar.gz

After a successful run, wait a little while you can see it in your Baidu cloud

Can build a soft chain, to map this folder to a place, hehe

The attachment is the code I picked up from GitHub.

Try the Baidu cloud client on Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.