File-Dropbox
view release on metacpan or search on metacpan
NAME
File::Dropbox - Convenient and fast Dropbox API abstraction
SYNOPSIS
use File::Dropbox;
use Fcntl;
# Application credentials
my %app = (
oauth2 => 1,
access_token => $access_token,
);
my $dropbox = File::Dropbox->new(%app);
# Open file for writing
open $dropbox, '>', 'example' or die $!;
while (<>) {
# Upload data using 4MB chunks
print $dropbox $_;
}
# Commit upload (optional, close will be called on reopen)
close $dropbox or die $!;
# Open for reading
open $dropbox, '<', 'example' or die $!;
# Download and print to STDOUT
# Buffered, default buffer size is 4MB
print while <$dropbox>;
# Reset file position
seek $dropbox, 0, Fcntl::SEEK_SET;
# Get first character (unbuffered)
say getc $dropbox;
close $dropbox;
DESCRIPTION
"File::Dropbox" provides high-level Dropbox API abstraction based on
Tie::Handle. Code required to get "access_token" and "access_secret" for
signed OAuth 1.0 requests or "access_token" for OAuth 2.0 requests is
not included in this module. To get "app_key" and "app_secret" you need
to register your application with Dropbox.
At this moment Dropbox API is not fully supported, "File::Dropbox"
covers file read/write and directory listing methods. If you need full
API support take look at WebService::Dropbox. "File::Dropbox" main
purpose is not 100% API coverage, but simple and high-performance file
operations.
Due to API limitations and design you can not do read and write
operations on one file at the same time. Therefore handle can be in
read-only or write-only state, depending on last call to open. Supported
functions for read-only state are: open, close, seek, tell, readline,
read, sysread, getc, eof. For write-only state: open, close, syswrite,
print, printf, say.
All API requests are done using Furl module. For more accurate timeouts
Net::DNS::Lite is used, as described in Furl::HTTP. Furl settings can be
overriden using "furlopts".
METHODS
new
my $dropbox = File::Dropbox->new(
( run in 0.827 second using v1.01-cache-2.11-cpan-39bf76dae61 )