Deleting Empty Directory of FTP Server

Advertisement

Wil
Guest

Deleting Empty Directory of FTP Server

This is a great system, and I have done pretty much everything that I have wanted, but struggling, one last point.

I'm trying to delete an empty directory with an automated process, and not having any luck.

I can use the command prompt FTP and remove the directory with the command:

ftp> ls Trinity_00076_20170204_194014
200 Port OK
150 Opening data connection
226 Transfer complete
ftp> rm Trinity_00076_20170204_194014
250 Directory removed
ftp> ls Trinity_00076_20170204_194014
200 Port OK
550 S_dosFsLib_FILE_NOT_FOUND

<group name="rm -- &quot;/ata0:1/Echelon/Trinity_00076_20170204_194014/&quot;" start="2017-02-06T18:47:49.269Z">
<rm>
<filename value="/ata0:1/Echelon/Trinity_00076_20170204_194014/" />
<result success="false">
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00076_20170204_194014/'.</message>
</result>
</rm>
<failure>
<message>Internal error fz#removedir (0010).</message>
<message>Error deleting file '/ata0:1/Echelon/Trinity_00076_20170204_194014/'.</message>
</failure>
</group>

Any ideas on what could be happening? I am using the following line of code to do this:

var result = session.RemoveFiles(GetDirectoryName(file));

With the result of result.IsSuccess = False

Thanks - Wil

Reply with quote

Advertisement

Wil
Guest

More Info

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>

Reply with quote

Advertisement

You can post new topics in this forum