DataSift\Storyplayer\OsLib\OsBase::getFileDetails PHP Method

getFileDetails() public method

public getFileDetails ( $hostDetails, $filename )
    public function getFileDetails($hostDetails, $filename)
    {
        // get a client
        $client = $this->getClient($this->st, $hostDetails);
        // upload our Python script to help us out here
        $rand = rand(0, 999999);
        $destFilename = "/tmp/st-{$rand}.py";
        $client->uploadFile(__DIR__ . "/path_helper.py", $destFilename);
        // run the script to inspect the filename
        $statCommand = "python {$destFilename} {$filename}";
        $result = $client->runCommand($statCommand);
        // did it work?
        if ($result->returnCode !== 0) {
            return null;
        }
        $retval = json_decode($result->output);
        // all done
        return $retval;
    }