Skip to content

Instantly share code, notes, and snippets.

@robjshaw
Created November 12, 2015 00:27
Show Gist options
  • Select an option

  • Save robjshaw/8da07c80da59b4bb0f31 to your computer and use it in GitHub Desktop.

Select an option

Save robjshaw/8da07c80da59b4bb0f31 to your computer and use it in GitHub Desktop.
playing around with large files
<cfscript>
queue = createobject('component', 'ecgateway.owi.business.services.queue');
folderName = createUUID();
</cfscript>
<cfdirectory action="create" directory="/tmp/#folderName#" mode="777">
<cffile action="copy" source="/tmp/msns_50k.txt" destination="/tmp/#folderName#/" />
<cfexecute name="split" arguments="-l 500 /tmp/#folderName#/msns_50k.txt /tmp/#folderName#/" />
<cffile action="delete" file="/tmp/#folderName#/msns_50k.txt" />
<cfdirectory directory="/tmp/#folderName#/" name="fileSpilts" action="list" />
<cfloop query="fileSpilts">
<cffile action="read" file="/tmp/#folderName#/#fileSpilts.name#" variable="batchFile" />
<cfscript>
arguments = {};
arguments.fileContents = batchFile;
jobid = queue.addJob(doFunction = 'queueHealthCheck', doComponent = 'ecgateway.owi.business.services.queue', stArguments = arguments);
writeoutput('<li>Your jobid:' & jobid & '</li>');
</cfscript>
<cfflush />
</cfloop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment