[HTLP] function.file-get-contents error.

Discussion in 'PHP' started by proxywhereabouts, Apr 26, 2011.

  1. #1
    Can anyone help me with this? I'm using torrentflux-ng. Everything is working fine, even it shows me this error, the torrent file uploaded just fine to the server and downloading just fine, it just that it must be something wrong if it shows me this error. Tried to post it in tf-ng forum but no one was looking after the forum and every post goes to moderation.

    Hope someone with good knowledge of torrentflux can help me here.

    Warning: file_get_contents(/home/user/public_html/tf-ng/downloads/.transfers/whatever-file-here.torrent.stat) [function.file-get-contents]: failed to open stream: No such file or directory in /home/user/public_html/tf-ng/inc/classes/StatFile.php on line 212
    Code (markup):
    Code in StatFile.php line 212:
    /**
    	 * Common write Method
    	 *
    	 * @return boolean
    	 */
    	function write() {
    		// content
    		$content  = $this->running."\n";
    		$content .= $this->percent_done."\n";
    		$content .= $this->time_left."\n";
    		$content .= $this->down_speed."\n";
    		$content .= $this->up_speed."\n";
    		$content .= $this->transferowner."\n";
    		$content .= $this->seeds."\n";
    		$content .= $this->peers."\n";
    		$content .= $this->sharing."\n";
    		$content .= $this->seedlimit."\n";
    		$content .= $this->uptotal."\n";
    		$content .= $this->downtotal."\n";
    		$content .= $this->size;
    		if ($content != file_get_contents($this->theFile)) {
    			// write file
    			if ($handle = @fopen($this->theFile, "w")) {
    				$resultSuccess = (@fwrite($handle, $content) !== false);
    				@fclose($handle);
    				return $resultSuccess;
    			}
    			return false;
    		}
    		return true;
    	
    PHP:
     
    proxywhereabouts, Apr 26, 2011 IP
  2. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    May be a stupid question, but you never know. Are you sure the file actually exists/appropriate permissions are available for said file?
     
    TimK, Apr 26, 2011 IP
  3. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Not stupid at all.
    Yes, the file actually exists in the said folder. I already confirm it has correct permission, I even change it to 0777 and still the error occured.

    Any idea?
     
    proxywhereabouts, Apr 26, 2011 IP
  4. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you have anything in the .htaccess file that might cause rewriting of the file name? I'm sort of stumped as to what else would cause this.
     
    TimK, Apr 26, 2011 IP
  5. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #5
    What do you mean rewriting the file name? Nothing got rewritten as far as I can see.
     
    proxywhereabouts, Apr 26, 2011 IP
  6. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Like, are you using mod_rewrite in your .htaccess file to craft your links? That probably wouldn't have an effect on it but I'm not sure what else would at this point. Also, is it only this specific torrent that isn't working or is it all of them?
     
    TimK, Apr 26, 2011 IP
  7. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #7
    I believe you're not familiar with torrentflux script.
    No, there is no mod_rewrite used in my htaccess.
    This error shown no matter what torrent I uploaded.

    Although I want to try modify the script to use /folder/ instead of /.folder/
     
    proxywhereabouts, Apr 26, 2011 IP