From time to time, your database applications may require certain files to be placed in certain directories. Such files can include preference files, Perl scripts or Applescript files, among others. One way to make sure that the files are found in the correct location is to store the files as blobs in a table and have your 4D application create the files when starting up for the first time. Below is a quick example of both reading in the file as a blob and writing out the blob to a file.
`Store the file as a blob variable
ON ERR CALL("Doc_Exist")
ON ERR CALL("")
DOCUMENT TO BLOB(Document;$blob)
`Write out the blob into a file. The variable $file contains the absolute path.
BLOB TO DOCUMENT($file;[[Table]Blob_Field)