Try

    $pickupFile = new Varien_Io_Ftp();
    
    $localFile = "/path/to/local/dir";
    $remoteFile = "/path/to/remote/dir/text.txt"
    
    mkdir($localFile, 0700, true);
    
    try {
        $pickupFile->open(
            array(
                'host'      => $host,
                'user'      => $username,
                'password'  => $password,
                'timeout'   => '10'
            )
        );
    
        $pickupFile->read($remoteFile, $localFile);
    
    
    } catch (Exception $e) {
        var_dump($e);
    }


See [Varien_Io_Ftp][1]

Also for security you way want to use [Varien_Io_Sftp][2]


  [1]: http://docs.magentocommerce.com/Varien/Varien_Io/Varien_Io_Ftp.html#read
  [2]: http://docs.magentocommerce.com/Varien/Varien_Io/Varien_Io_Sftp.html