Topic "Deleting Empty Directory of FTP Server"

Author Message
Wil

Guest


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
Wil

Guest


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>
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26711
Location: Prague, Czechia
Duplicate post:
https://winscp.net/forum/viewtopic.php?t=24512
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License