GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
urlwrite.cc File Reference
#include <string>
#include <fstream>
#include <iomanip>
#include <iostream>
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "oct-env.h"
#include "oct-handle.h"
#include "glob-match.h"
#include "url-transfer.h"
#include "defun.h"
#include "error.h"
#include "interpreter.h"
#include "oct-map.h"
#include "oct-refcount.h"
#include "ov-cell.h"
#include "ovl.h"
#include "pager.h"
#include "unwind-prot.h"
#include "url-handle-manager.h"
Include dependency graph for urlwrite.cc:

Go to the source code of this file.

Functions

static void delete_file (const std::string &file)
 
OCTAVE_EXPORT octave_value_list F__ftp__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_ascii__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_binary__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_close__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_cwd__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_delete__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_dir__ (octave::interpreter &interp, const octave_value_list &args, int nargout)
 
OCTAVE_EXPORT octave_value_list F__ftp_mget__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_mkdir__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_mode__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_mput__ (octave::interpreter &interp, const octave_value_list &args, int nargout)
 
OCTAVE_EXPORT octave_value_list F__ftp_pwd__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_rename__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list F__ftp_rmdir__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Furlwrite (const octave_value_list &args, int nargout) ar
 
 if (nargin !=2 &&nargin !=4) print_usage()
 
 if (nargin==4)
 
 if (! ofile.is_open()) error("urlwrite
 
std::ofstream ofile (filename.c_str(), std::ios::out|std::ios::binary)
 

Variables

nd group nd example The full path of the downloaded file is returned in ar {f}. The variable ar{success} is 1 if the download was successful
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the and FILE protocols Username and password may be specified in the for example
 
std::string filename = args(1).xstring_value ("urlwrite: LOCALFILE must be a string")
 
octave::sys::file_stat fs (filename)
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the FTP
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the HTTP
 
std::string method
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among others
 
Array< std::stringparam
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl supports
 
nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the and FILE protocols Username and password may be specified in the URL
 
std::string url = args(0).xstring_value ("urlwrite: URL must be a string")
 

Function Documentation

◆ delete_file()

static void delete_file ( const std::string file)
static

Definition at line 56 of file urlwrite.cc.

References file, and octave::sys::unlink().

Referenced by F__ftp_mget__().

◆ F__ftp__()

OCTAVE_EXPORT octave_value_list F__ftp__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_ascii__()

OCTAVE_EXPORT octave_value_list F__ftp_ascii__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_binary__()

OCTAVE_EXPORT octave_value_list F__ftp_binary__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_close__()

OCTAVE_EXPORT octave_value_list F__ftp_close__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_cwd__()

OCTAVE_EXPORT octave_value_list F__ftp_cwd__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_delete__()

OCTAVE_EXPORT octave_value_list F__ftp_delete__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_dir__()

◆ F__ftp_mget__()

◆ F__ftp_mkdir__()

OCTAVE_EXPORT octave_value_list F__ftp_mkdir__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_mode__()

OCTAVE_EXPORT octave_value_list F__ftp_mode__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_mput__()

◆ F__ftp_pwd__()

OCTAVE_EXPORT octave_value_list F__ftp_pwd__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_rename__()

OCTAVE_EXPORT octave_value_list F__ftp_rename__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ F__ftp_rmdir__()

OCTAVE_EXPORT octave_value_list F__ftp_rmdir__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ Furlwrite()

OCTAVE_EXPORT octave_value_list Furlwrite ( const octave_value_list args,
int  nargout 
)

Definition at line 110 of file urlwrite.cc.

◆ if() [1/3]

if ( nargin = 2 &&nargin !=4)

◆ if() [2/3]

◆ if() [3/3]

if ( ! ofile.  is_open())

Definition at line 147 of file urlwrite.cc.

◆ ofile()

std::ofstream ofile ( filename.  c_str(),
std::ios::out|std::ios::binary   
)

Variable Documentation

◆ ar

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case ar {f}. The variable ar{success} is 1 if the download was successful

Definition at line 110 of file urlwrite.cc.

◆ example

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the and FILE protocols Username and password may be specified in the for example

Definition at line 110 of file urlwrite.cc.

◆ filename

◆ fs

◆ FTP

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the FTP

Definition at line 110 of file urlwrite.cc.

◆ HTTP

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the HTTP

Definition at line 110 of file urlwrite.cc.

◆ method

◆ others

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among others

Definition at line 110 of file urlwrite.cc.

◆ param

◆ supports

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl supports

Definition at line 110 of file urlwrite.cc.

◆ URL

nd group nd example The full path of the downloaded file is returned in otherwise it is in which case then the error is signaled through Octave s error handling mechanism This function uses libcurl Curl among the and FILE protocols Username and password may be specified in the URL

Definition at line 110 of file urlwrite.cc.

◆ url