Sync Folder from Window to Linux - Uploaded file permission not change
Hi,
I am synchronize my windows folder to linux folder.
I change transfer options file permission but it remains default (rw------)
My Code is as below:
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = xxxxx,
UserName = xxxxx,
Password = xxxxx,
};
using (Session session = new Session())
{
session.FileTransferred += FileTransferred;
session.Open(sessionOptions);
TransferOptions option = new TransferOptions();
FilePermissions filePermission = new FilePermissions();
filePermission.GroupExecute = true;
filePermission.GroupRead = true;
filePermission.GroupWrite = true;
filePermission.OtherExecute = true;
filePermission.OtherRead = true;
filePermission.OtherWrite = true;
filePermission.UserExecute = true;
filePermission.UserRead = true;
filePermission.UserWrite = true;
option.FilePermissions = filePermission;
SynchronizationResult synchronizationResult;
synchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Remote, local folder path, remote folder path, false, false, SynchronizationCriteria.Size, option);
synchronizationResult.Check();
}
I am synchronize my windows folder to linux folder.
I change transfer options file permission but it remains default (rw------)
My Code is as below:
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = xxxxx,
UserName = xxxxx,
Password = xxxxx,
};
using (Session session = new Session())
{
session.FileTransferred += FileTransferred;
session.Open(sessionOptions);
TransferOptions option = new TransferOptions();
FilePermissions filePermission = new FilePermissions();
filePermission.GroupExecute = true;
filePermission.GroupRead = true;
filePermission.GroupWrite = true;
filePermission.OtherExecute = true;
filePermission.OtherRead = true;
filePermission.OtherWrite = true;
filePermission.UserExecute = true;
filePermission.UserRead = true;
filePermission.UserWrite = true;
option.FilePermissions = filePermission;
SynchronizationResult synchronizationResult;
synchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Remote, local folder path, remote folder path, false, false, SynchronizationCriteria.Size, option);
synchronizationResult.Check();
}