Results 1 to 3 of 3
  1. #1
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    Opening CJ feeds .gz
    I'm trying to find an efficient way to open the feeds that CJ is transferring onto my server. Up until now I created a new php file that had a gunzip command pointing at the file.

    I've been working on a way to simply open any .gz file that is found in the datafeed directory. Here is where I am at this (all you code geeks, no laughing! it's the best I can do with my limited skills. )

    PHP Code:
    $directory="datafeed";
       
        
    $dirhandler opendir($directory);
     
           
    $nofiles=0;
        while (
    $file readdir($dirhandler)) {
             
            if (
    $file != '.' && $file != '..')
            {
                
    $nofiles++;
                
    $files[$nofiles]=$file;                
            }   
        }

    foreach(
    $files as $key => $fileName)
            {

    $ext substr(strrchr($fileName'.'), 1);
    if (
    $ext == "gz"){ 
    exec("gunzip ./$directory/$fileName");
    }    

    (have to use exec due to the site being on hostgator)
    It actually works fine except it seems not to gunzip one or two files each time I run it. Is there something I'm missing that would keep it from opening the last file in the directory?
    Someday starts today
    Military Discounts

  2. #2
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    Found the issue. the file that I couldn't open was alphabetically last, so I presumed it had something to do with the script. It was because when uncompressed the file is almost 300 meg, I didn't have enough room on the site. I changed the space quota and it opened fine.

    Sorry for the false alarm.
    Someday starts today
    Military Discounts

  3. #3
    Full Member
    Join Date
    January 18th, 2005
    Posts
    396
    I use gzip -d (decode, I guess) *.gz --- could '*.gz' work for you in place of picking each filename?

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Data Feeds / Product Feeds
    By doogie18 in forum Commission Junction - CJ
    Replies: 6
    Last Post: December 29th, 2008, 06:23 PM
  2. Re-opening Merchants
    By yintercept in forum ShareASale - SAS
    Replies: 0
    Last Post: November 16th, 2007, 10:30 PM
  3. Amazon feeds and other feeds combied?
    By hosst in forum Amazon
    Replies: 0
    Last Post: November 13th, 2003, 11:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •