Function to insert a file into the dbfiles table as an input

dbfile.input.insert(in.path, in.prefix, siteid, startdate, enddate,
  mimetype, formatname, parentid = NA, con,
  hostname = PEcAn.remote::fqdn(), allow.conflicting.dates = FALSE)

Arguments

in.path

path to the directory containing the file to be inserted

in.prefix

initial portion of the filename that does not vary by date. Does not include directory; specify that as part of in.path

siteid

the id of the site that this data is applicable to

startdate

the start date of the data stored in the file

enddate

the end date of the data stored in the file

mimetype

the mime-type of the file

formatname

the name of the format to distinguish between simmilair mime-types

parentid

the id of the parent of the input

con

database connection object

hostname

the name of the host where the file is stored, this will default to the name of the current machine

allow.conflicting.dates

Whether to allow a new input record with same siteid, name, and format but different start/end dates

Value

data.frame with the id, filename and pathname of the input that is requested

Details

This will write into the dbfiles, inputs, machines and formats the required data to store the file

Examples

# NOT RUN {
  dbfile.input.insert('trait.data.Rdata', siteid, startdate, enddate, 'application/x-RData', 'traits', dbcon)
# }