void CopyFile(ProgressMonitor monitor, string src, string dest, DeployFileAttributes atts) { dest = FileService.GetFullPath(dest); monitor.Log.WriteLine(GettextCatalog.GetString("Deploying file {0}.", dest)); string targetDir = Path.GetDirectoryName(dest); if (!Directory.Exists(targetDir)) { Directory.CreateDirectory(targetDir); } FileService.CopyFile(src, dest); Mono.Unix.Native.FilePermissions perms = Mono.Unix.Native.FilePermissions.DEFFILEMODE; if ((atts & DeployFileAttributes.Executable) != 0) { perms |= Mono.Unix.Native.FilePermissions.S_IXGRP | Mono.Unix.Native.FilePermissions.S_IXUSR | Mono.Unix.Native.FilePermissions.S_IXOTH; } if ((atts & DeployFileAttributes.ReadOnly) != 0) { perms &= ~(Mono.Unix.Native.FilePermissions.S_IWGRP | Mono.Unix.Native.FilePermissions.S_IWOTH | Mono.Unix.Native.FilePermissions.S_IWUSR); } if (perms != Mono.Unix.Native.FilePermissions.DEFFILEMODE) { Mono.Unix.Native.Syscall.chmod(dest, perms); } }
public DeployFile(ProjectFile pfile) { DeployProperties props = DeployService.GetDeployProperties(pfile); this.targetDirectoryID = props.TargetDirectory; this.sourcePath = pfile.FilePath; this.relativeTargetPath = props.RelativeDeployPath; this.attributes = props.FileAttributes; if (props.HasPathReferences) { isTemplate = true; } sourceSolutionItem = pfile.Project; }
void CopyFile (ProgressMonitor monitor, string src, string dest, DeployFileAttributes atts) { dest = FileService.GetFullPath (dest); monitor.Log.WriteLine (GettextCatalog.GetString ("Deploying file {0}.", dest)); string targetDir = Path.GetDirectoryName (dest); if (!Directory.Exists (targetDir)) Directory.CreateDirectory (targetDir); FileService.CopyFile (src, dest); Mono.Unix.Native.FilePermissions perms = Mono.Unix.Native.FilePermissions.DEFFILEMODE; if ((atts & DeployFileAttributes.Executable) != 0) perms |= Mono.Unix.Native.FilePermissions.S_IXGRP | Mono.Unix.Native.FilePermissions.S_IXUSR | Mono.Unix.Native.FilePermissions.S_IXOTH; if ((atts & DeployFileAttributes.ReadOnly) != 0) perms &= ~(Mono.Unix.Native.FilePermissions.S_IWGRP | Mono.Unix.Native.FilePermissions.S_IWOTH | Mono.Unix.Native.FilePermissions.S_IWUSR); if (perms != Mono.Unix.Native.FilePermissions.DEFFILEMODE) Mono.Unix.Native.Syscall.chmod (dest, perms); }