public static IScriptCommand DiskParseOrCreateArchive(string profileVariable = "{Profile}", string pathVariable = "{Path}", string destVariable = "{Entry}", IScriptCommand nextCommand = null) { return (CoreScriptCommands.ParsePath(profileVariable, pathVariable, destVariable, nextCommand, //FoundCommand //NotFoundCommand CoreScriptCommands.DiskCreatePath(profileVariable, pathVariable, false, destVariable, NameGenerationMode.NoRename, IOScriptCommands.AssignArchiveBytes(pathVariable, "{ArchiveBytes}", CoreScriptCommands.DiskOpenStream(destVariable, "{DestStream}", FileAccess.Write, CoreScriptCommands.CopyStream("{ArchiveBytes}", "{DestStream}"), CoreScriptCommands.ParsePath(profileVariable, pathVariable, destVariable, nextCommand)))))); }
/// <summary> /// Serializable, Copy contents from file1 to file2 /// </summary> /// <param name="sourceFileVariable">Filepath of source</param> /// <param name="destinationFileVariable">Filepath of destination</param> /// <param name="nextCommand"></param> /// <returns></returns> public static IScriptCommand DiskCopyFile(string sourceProfileVariable = "{SourceProfile}", string sourceFileVariable = "{SourceFile}", string destinationProfileVariable = "{DestinationProfile}", string destinationFileVariable = "{DestinationFile}", IScriptCommand nextCommand = null) { return(CoreScriptCommands.ParsePath(sourceProfileVariable, sourceFileVariable, dcSourceVariable, CoreScriptCommands.DiskParseOrCreateFile(destinationProfileVariable, destinationFileVariable, dcDestVariable, CoreScriptCommands.DiskOpenStream(dcSourceVariable, "{SourceStream}", FileExplorer.Defines.FileAccess.Read, CoreScriptCommands.DiskOpenStream(dcDestVariable, "{DestinationStream}", FileExplorer.Defines.FileAccess.Write, CoreScriptCommands.CopyStream("{SourceStream}", "{DestinationStream}", CoreScriptCommands.NotifyEntryChanged(ChangeType.Created, null, dcSourceVariable, null, dcDestVariable, ScriptCommands.Reset(nextCommand, dcSourceVariable, dcDestVariable)))))), ResultCommand.Error(new FileNotFoundException(sourceFileVariable)))); }
/// <summary> /// Serializable, parse a path and go to specified directory. /// </summary> /// <param name="explorerVariable"></param> /// <param name="profileVariable"></param> /// <param name="pathOrPathVariable"></param> /// <param name="nextCommand"></param> /// <returns></returns> public static IScriptCommand ExplorerParseAndGoTo(string explorerVariable = "{Explorer}", string profileVariable = "{Profile}", string pathOrPathVariable = "", IScriptCommand nextCommand = null) { return(CoreScriptCommands.ParsePath(profileVariable, pathOrPathVariable, "{GoTo-Directory}", ExplorerGoTo(explorerVariable, "{Goto-Directory}", nextCommand))); }