I'm pretty new to Magento dev so forgive me if some of my terminology isn't quite right.
My module needs to download and delete XML files from a remote FTP server using the sftp protocol. I'm using the Varien_Io_Sftp class to do that.
I'm able to open the connection, change to the needed directory and retrieve the file but when I try to delete it using the Varien_Io_Sftp rm method the remote file is not deleted.
<?php $vcXMLOut = "/XML/export"; $filename = "test.txt" $sftpGetFiles = new Varien_Io_Sftp(); $sftpGetFiles->open( array( 'host' => "ftp.test.com", 'username' => "test", 'password' => "test", 'timeout' => '100' ) ); $sftpGetFiles->cd($vcXMLOut); $file = $sftpGetFiles->read($filename); //Contents of file are read successfully $sftpGetFiles->rm($filename); //File remains
I've ruled out permissions problems on the file.
I'm not sure why I'm not getting any errors anywhere. Is it because this code is being run in a cron schedule? The database says the scheduled jobs were successful. Nothing that I can find in any logs.
Any idea what I'm doing wrong here? Anyone have any ideas how I could better debug this code?