Esempio n. 1
0
 /// <summary>
 /// Modify the permissions of the given file/folder.
 /// Only works on *NIX systems, and not on Windows/IIS servers.
 /// Only works if the FTP server supports the SITE CHMOD command
 /// (requires the CHMOD extension to be installed and enabled).
 /// Throws FtpCommandException if there is an issue.
 /// </summary>
 /// <param name="path">The full or relative path to the item</param>
 /// <param name="owner">The owner permissions</param>
 /// <param name="group">The group permissions</param>
 /// <param name="other">The other permissions</param>
 public void SetFilePermissions(string path, FtpPermission owner, FtpPermission group, FtpPermission other)
 {
     SetFilePermissions(path, FtpExtensions.CalcChmod(owner, group, other));
 }
Esempio n. 2
0
 /// <summary>
 /// Modify the permissions of the given file/folder.
 /// Only works on *NIX systems, and not on Windows/IIS servers.
 /// Only works if the FTP server supports the SITE CHMOD command
 /// (requires the CHMOD extension to be installed and enabled).
 /// Throws FtpCommandException if there is an issue.
 /// </summary>
 /// <param name="path">The full or relative path to the item</param>
 /// <param name="owner">The owner permissions</param>
 /// <param name="group">The group permissions</param>
 /// <param name="other">The other permissions</param>
 /// <param name="token">The token that can be used to cancel the entire process</param>
 public Task SetFilePermissionsAsync(string path, FtpPermission owner, FtpPermission group, FtpPermission other, CancellationToken token = default(CancellationToken))
 {
     return(SetFilePermissionsAsync(path, FtpExtensions.CalcChmod(owner, group, other), token));
 }
Esempio n. 3
0
 /// <summary>
 /// Calculates the CHMOD value from the permissions flags
 /// </summary>
 public static void CalculateChmod(this FtpListItem item)
 {
     item.Chmod = FtpExtensions.CalcChmod(item.OwnerPermissions, item.GroupPermissions, item.OthersPermissions);
 }