Topic "Error condition remote serve file 'in use'"

Author Message
Philky001
[View user's profile]
Donor
Joined: 2015-11-24
Posts: 20
HI I got this error: it seems the file trying to delete was in use. How would you explain this happening, since we only use the batch process now?

Is only explanation that someone was looking at this order at the moment the batch process was running?

Going further, what would you do to code to fix this issue?


Looping for WALMART
File Path \\SERVER-W02\ARCUST\IBS\DATA\ORDERS\WALMART\
File Tranfer successful from /outgoing/orders/WALMART//1277157481.md.neworders to \\SERVER-W02\ARCUST\IBS\DATA\ORDERS\WALMART\1277157481.md.neworders
Error Occurse:WinSCP.SessionRemoteException: Error deleting file '/outgoing/orders/WALMART/1277172050.md.neworders'. ---> WinSCP.SessionRemoteException: Permission denied.
Error code: 3
Error message
from server: Failed to delete file /outgoing/orders/WALMART/1277172050.md.neworders: The process cannot access the file
'\\COMPLETEFTPFS01\sftp_share\sftp_fs\outgoing\orders\WALMART\1277172050.md.neworders' because it is being used by another process.



--- End of inner exception stack trace ---
at WinSCP.OperationResultBase.Check()
at SFTPGetConsole.Program.Main()
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Well, we can hardly explain that.
We do not know anything about your server.

Is it happening always, with some files, randomly, ...?
Philky001
[View user's profile]
Donor
Joined: 2015-11-24
Posts: 20
it happened one time only for past week. this means that someone was open that file is the only explanation?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Yes, I'd say so.
Philky001
[View user's profile]
Donor
Joined: 2015-11-24
Posts: 20
on the scp getfiles - can it have the delete portion put on a slight delay
or something like

session.GetFiles(RemotePath + "/" + fileInfo.Name, LocalPath + fileInfo.Name, ).Check();
// make some time delay for 5 seconds.

// now run to delete
session.GetFiles(RemotePath + "/" + fileInfo.Name, LocalPath + fileInfo.Name, true).Check();
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Call the Session.GetFiles without the "remove" flag, wait 5 seconds, and then iterate the list of downloaded files returned by the function, calling Session.RemoveFiles for each.
Advertisements

You can post new topics in this forum






Search Site

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