Is it possible for emacs to load a buffer from a Amazon S3 bucket?
Is it possible for emacs to load a buffer from a Amazon S3 开发者_JAVA技巧bucket? If so has somebody already built something that can do this?
Have you tried using curl?
In which case, you could do something like (untested):
(defun grab-s3-bucket (url)
(interactive "sURL for Amazon s3 bucket: ")
(shell-command (format "curl -O %s" url) (get-buffer-create url)))
M-x grab-s3-bucket URL
You could write the results back with something like:
(defun write-s3-bucket (url)
(interactive "sURL for Amazon s3 bucket: ")
(shell-command-on-region (format "curl %s -T " url)))
You could even get tricky and bind C-x C-s to the write-s3-bucket
, using a buffer local variable to store the URL for the s3 bucket (that would get created upon the call to grab-s3-bucket
).
You could use S3fs to mount a local filesystem mapped to a s3 drive and access the file normally with emacs.
If you would like to eval the file as well, you can do this:
(with-temp-buffer
(shell-command "wget -q -O- URL_TO_FILE" (current-buffer))
(eval-buffer))
精彩评论