SaveFile
Back to ListDescription: Save a text variable to a file, given filename and content
FileMaker Prototype:
Set Variable [$res; ACFU_SaveFile( string_filename; string_content)]
Category: BOOTSTRAP
NOTE: The bootstrap library comes preloaded in the plugin. Read more
Function source:
function SaveFile (string filename, string content )
FunctionID 201;
int x;
x = open (filename, "w");
write (x, content);
close ( x );
return 1;
end
SaveFile is a function to put content on files. It opens the specified file and write the content on it, and closes it.
Example
Set Variable [$res; ACFU_SaveFile( "~/Desktop/MySampleOutput"; "This is the sample content")]
If the file does not exists, it will be created. If the save is successfull, it returns "1", otherwise an error message. The directory path need to exist.
See also: OpenOutputFile
