SharpCifs.Std icon indicating copy to clipboard operation
SharpCifs.Std copied to clipboard

CreateNewFile and Log question

Open psoiya opened this issue 7 years ago • 2 comments

Hello,

I am having an issue with the CreateNewFile method. It seems to be taking around a minute to create a new file. I was also wondering if the log file gets written anywhere? I am trying to look in the log file to see if I can see why it is taking so long.

Best, Paul

psoiya avatar Jan 09 '18 14:01 psoiya

Thanks for telling! Please give me some time, I'll try it.

ume05rw avatar Jan 12 '18 02:01 ume05rw

Sorry I made you wait.

In my test environment, file creation never took a minute. Can you tell me your environment? Server App name, version, and client device, os ..etc.

The log output to Console.Error by default. When outputting to a file like this:

using (var file = new FileStream("C:\\sharpcifs.log", FileMode.OpenOrCreate, FileAccess.ReadWrite))
using (var writer = new StreamWriter(file, System.Text.Encoding.UTF8))
{
    writer.Write("log start");
    SharpCifs.Util.LogStream.SetInstance(writer);
    var logger = SharpCifs.Util.LogStream.GetInstance();
    logger.Level = 3;
    
    [any logic...]
    
}

log like:

log startdoConnect: 192.168.254.11
open0: \SharpCifsTest2\bigfile.zip
close: 58583
doConnect: 0.0.0.0<00>/192.168.254.11
doConnect: 0.0.0.0<00>/192.168.254.11
open0: \srvsvc
close: 37764
doConnect: 0.0.0.0<00>/192.168.254.11
doFindFirstNext: \
doConnect: 0.0.0.0<00>/192.168.254.11
doConnect: SAMBA<1D>/192.168.254.11
doConnect: 192.168.254.11
doConnect: 0.0.0.0<00>/192.168.254.11
open0: \srvsvc
close: 23530

ume05rw avatar Feb 04 '18 13:02 ume05rw