Sync Folder from Window to Linux - Uploaded file permission not change

Advertisement

nevil_doshi
Joined:
Posts:
2

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();
}

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Sync Folder from Window to Linux - Uploaded file permission not change

Do you expect the code to change permissions of the existing remote files? (it won't)

Or is the problem even with newly uploaded (synchronized) files?

Reply with quote

nevil_doshi
Joined:
Posts:
2

Re: Sync Folder from Window to Linux - Uploaded file permission not change

Thanks for your reply..

My issue was solved actually I am using EC2 instance and I access one folder by FTP user and also by web(www-data) so there is some issue regarding permission when new file is created by FTP user.

It is solved by changing permission of FTP user on server side.

Thanks for your time..

Regards,

Nevil Doshi

Reply with quote

Advertisement

You can post new topics in this forum