PrePAN

Sign in to PrePAN

File::Dropbox Dropbox API abstraction (based on Tie::Handle)

Author
n4kz@github
Date
URL
https://github.com/n4kz/File-Dropbox
Status
In Review
Good

Synopsis

        use File::Dropbox;

        # Application credentials
        my %app = (
            app_key       => 'app key',
            app_secret    => 'app secret',
            access_token  => 'access token',
            access_secret => 'access secret',
        );

        my $dropbox = File::Dropbox->new(%app);

        open $dropbox, '>', 'example' or die $!;

        while (<>) {
            print $dropbox $_;
        }

        close $dropbox or die $!;

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 requests is not included in this module.

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.

Comments

Please sign up to post a review.