Write a File Locally I am trying to write files and read from them.  The following code works great on my local Kalabox server, but when I push to Pantheon, the files don't get written.

Could it be because all files are under sub versioning on Pantheon?

$csv_text = array2csv($db_result);
save_csv_file($csv_text);


if($_GET[save_to_email] == 'true'){
    save_defaults();
}


function save_csv_file( $csv_text){
    //$file = './inventory.csv';
    $file = 'public://inventory.csv';
    file_put_contents($file, $csv_text);
}


function save_defaults(){
    $default_vals = get_inventory_defaults();
    $default_vals[sort_direction] = $_GET[sort_direction];
    $default_vals[threshold] = $_GET[threshold];
    $default_vals[hide_zero_inventory] = $_GET[hide_zero_inventory];
    $default_vals[email] = $_GET[email];

    save_inventory_defaults($default_vals);
}

function get_inventory_defaults(){
    $file = './inventory_defaults.txt';
    //$file = 'public://inventory_defaults.txt';
    $content = unserialize(file_get_contents($file));
    return $content;
}

function save_inventory_defaults($my_variable){
    //$file = './inventory_defaults.txt';
    $file = 'public://inventory_defaults.txt';
    $content = serialize($my_variable);
    file_put_contents($file, $content);
    //file_save_data($content, $file, FILE_EXISTS_RENAME );
}

function array2csv(array &amp;$array)
{
   if (count($array) == 0) {
     return null;
   }
   ob_start();
   $df = fopen("php://output", 'w');
   fputcsv($df, array_keys(reset($array)));
   foreach ($array as $row) {
      fputcsv($df, $row);
   }
   fclose($df);
   return ob_get_clean();
}


I am not sure when to go from here... A million thanks!!
From Pantheon docs: "Pantheon cannot be used to host files over 256MB, no matter how the file is uploaded"

http://helpdesk.getpantheon.com/customer/portal/articles/745361-known-limitations

It could be that your file is too large and therefore Pantheon will not host it.