protected override ExitCode ExecuteFileTask() { string target = Arguments.GetOption <string>("target", "t"); int redirector = Array.IndexOf(Arguments.Targets, ">"); if (target == null && redirector == -1) { ResultLog.WriteLine(string.Join(" ", Arguments.Targets)); return(ExitCode.Success); } if (target == null) { if (redirector == Arguments.Targets.Length - 1) { StatusLog.WriteLine(WriteStyle.Error, XFileStrings.ErrorNoTargetSpecified); return(ExitCode.InvalidArgument); } target = Arguments.Targets[redirector + 1]; } target = GetFullPath(target); FileService.WriteAllText(target, string.Join(" ", redirector == -1 ? Arguments.Targets : Arguments.Targets.Take(redirector))); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { foreach (var stream in ExtendedFileService.GetAlternateStreamInformation(GetFullTargetPath())) { ResultLog.WriteLine($"Stream '{stream.Name}', Size {stream.Size}"); } return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { foreach (string pathName in ExtendedFileService.GetVolumeMountPoints(Arguments.Target)) { ResultLog.WriteLine(pathName); } return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { foreach (string drive in ExtendedFileService.GetLogicalDriveStrings()) { ResultLog.WriteLine(drive); } return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { using (var reader = FileService.CreateReader(GetFullTargetPath())) { string nextLine = null; while ((nextLine = reader.ReadLine()) != null) { ResultLog.WriteLine(nextLine); } } return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { string target = Arguments.Target; if (target == null) { target = "."; } string fullPath = ExtendedFileService.GetFinalPath(GetFullPath(target)); FileService.CurrentDirectory = fullPath; ResultLog.WriteLine(FileService.CurrentDirectory); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { string target = Arguments.Target; target = string.IsNullOrWhiteSpace(target) ? null : target; var targetPaths = from path in ExtendedFileService.QueryDosDeviceNames(target) orderby path select path; int count = 0; foreach (string path in targetPaths) { count++; ResultLog.WriteLine(path); } StatusLog.WriteLine("\nFound {0} paths", count); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { ResultLog.WriteLine(ExtendedFileService.GetVolumeName(Arguments.Target)); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { ResultLog.WriteLine(ExtendedFileService.GetMountPoint(GetFullTargetPath())); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { ResultLog.WriteLine(GetFullTargetPath()); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { ResultLog.WriteLine(FileService.CurrentDirectory); return(ExitCode.Success); }
protected override ExitCode ExecuteFileTask() { ResultLog.WriteLine(ExtendedFileService.GetDriveLetter(FileService, GetFullTargetPath())); return(ExitCode.Success); }