I'm using 5.9.3, and the same issues occurs when I use the following command. It removes all the data files in the directory, it just doesn't delete the empty directory afterwards. If I run this with deleteWhenSuccessfulFTP = false, the program runs with no problem.
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
bool deleteWhenSuccessfulFTP = true;
transferResult = session.GetFiles(GetDirectoryName(file), newDirectoryLocal, remove: deleteWhenSuccessfulFTP, options: transferOptions);
Here is the error log:
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/Trinity_00083_20170205_094107.srEvtdf" />
<result success="true" />
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>
<rm>
<filename value="/ata0:1/Echelon/Trinity_00083_20170205_094107/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00083_20170205_094107/'.</message>
</result>
</rm>