From ca1fc41b10a40fcdacb2bbccef4f74295986663d Mon Sep 17 00:00:00 2001 From: Kai Jaeger Date: Tue, 19 Dec 2023 12:07:13 +0100 Subject: [PATCH] Documentation polished --- .../CreateUserCommandHelpForProofreading.aplf | 16 + .../Cider/API/GetCiderAliasFileContent.aplf | 1 + APLSource/Cider/API/GetProjectPath.aplf | 1 - APLSource/Cider/CreateOpenParms.aplf | 2 +- APLSource/Cider/History.apla | 3 + .../TestCases/CheckTempDirForLeftOvers.aplf | 4 +- APLSource/TestCases/Initial_NuGet.aplf | 8 +- .../TestCases/Test_OpenAndClose_001.aplf | 2 +- APLSource/TestCases/Test_UC_030.aplf | 2 +- .../Test_Open_051/packages/apl-buildlist.json | 2 +- .../packages/apl-dependencies.txt | 2 +- .../APLSource/APLTreeUtils2.aplc | 48 +- .../LICENSE | 0 .../apl-package.json | 4 +- apl-package.json | 2 +- docs/Cider-API-Reference.md | 5 +- docs/Cider-User-Guide.md | 112 +-- docs/Contributing.md | 17 +- html/Cider-API-Reference.html | 8 +- html/Cider-User-Guide.html | 141 ++- html/Contributing.html | 16 +- tatin-packages/APLGit2_UC.dyalog | 825 ++++++++++++++++++ tatin-packages/apl-buildlist.json | 2 +- tatin-packages/apl-dependencies.txt | 2 +- .../APLSource/APLTreeUtils2.aplc | 0 .../aplteam-APLTreeUtils2-1.3.0}/LICENSE | 2 +- .../apl-package.json | 0 .../APLSource/FilesAndDirs/ADOC_Doc.apla | 40 + .../FilesAndDirs/API/AddTrailingSep.aplf | 1 + .../APLSource/FilesAndDirs/API/Cd.aplf | 1 + .../APLSource/FilesAndDirs/API/CheckPath.aplf | 1 + .../FilesAndDirs/API/CurrentSep.aplf | 2 + .../FilesAndDirs/API/DateToReal.aplf | 1 + .../FilesAndDirs/API/DeleteFile.aplf | 1 + .../APLSource/FilesAndDirs/API/Dir.aplf | 1 + .../FilesAndDirs/API/EnforceBackslash.aplf | 1 + .../FilesAndDirs/API/EnforceSlash.aplf | 1 + .../FilesAndDirs/API/ExecNfunction.aplo | 1 + .../APLSource/FilesAndDirs/API/Exists.aplf | 1 + .../FilesAndDirs/API/ExpandPath.aplf | 1 + .../FilesAndDirs/API/GetModifiedDate.aplf | 1 + .../FilesAndDirs/API/GetNewLineCharsFor.aplf | 1 + .../FilesAndDirs/API/GetTempFilename.aplf | 1 + .../FilesAndDirs/API/GetTempFilename2.aplf | 1 + .../FilesAndDirs/API/GetTempPath.aplf | 2 + .../FilesAndDirs/API/GetTempSubDir.aplf | 1 + .../APLSource/FilesAndDirs/API/IsDir.aplf | 1 + .../APLSource/FilesAndDirs/API/IsFile.aplf | 1 + .../FilesAndDirs/API/IsSymbolicLink.aplf | 1 + .../APLSource/FilesAndDirs/API/ListDirs.aplf | 1 + .../APLSource/FilesAndDirs/API/ListFiles.aplf | 1 + .../APLSource/FilesAndDirs/API/MkDir.aplf | 1 + .../APLSource/FilesAndDirs/API/NCREATE.aplf | 1 + .../APLSource/FilesAndDirs/API/NGET.aplf | 1 + .../APLSource/FilesAndDirs/API/NNAMES.aplf | 2 + .../APLSource/FilesAndDirs/API/NPUT.aplf | 1 + .../FilesAndDirs/API/NormalizePath.aplf | 1 + .../APLSource/FilesAndDirs/API/PWD.aplf | 2 + .../FilesAndDirs/API/PolishCurrentDir.aplf | 2 + .../APLSource/FilesAndDirs/API/RmDir.aplf | 1 + .../FilesAndDirs/API/RmDirByForce.aplf | 1 + .../APLSource/FilesAndDirs/API/Version.aplf | 2 + .../FilesAndDirs/API/YoungerThan.aplf | 1 + .../FilesAndDirs/AddTrailingSep.aplf | 6 + .../APLSource/FilesAndDirs/Cd.aplf | 31 + .../APLSource/FilesAndDirs/CheckPath.aplf | 26 + .../APLSource/FilesAndDirs/CurrentSep.aplf | 3 + .../APLSource/FilesAndDirs/DateToReal.aplf | 3 + .../APLSource/FilesAndDirs/DeleteFile.aplf | 41 + .../APLSource/FilesAndDirs/Dir.aplf | 149 ++++ .../APLSource/FilesAndDirs/EncodeBlanks.aplf | 1 + .../FilesAndDirs/EnforceBackslash.aplf | 3 + .../APLSource/FilesAndDirs/EnforceSlash.aplf | 4 + .../APLSource/FilesAndDirs/ExecNfunction.aplo | 25 + .../APLSource/FilesAndDirs/Exists.aplf | 10 + .../APLSource/FilesAndDirs/ExpandPath.aplf | 3 + .../APLSource/FilesAndDirs/GetLastError.aplf | 10 + .../FilesAndDirs/GetModifiedDate.aplf | 3 + .../FilesAndDirs/GetMsgFromError.aplf | 32 + .../FilesAndDirs/GetNewLineCharsFor.aplf | 8 + .../FilesAndDirs/GetTempFilename.aplf | 40 + .../FilesAndDirs/GetTempFilename2.aplf | 28 + .../APLSource/FilesAndDirs/GetTempPath.aplf | 18 + .../APLSource/FilesAndDirs/GetTempSubDir.aplf | 25 + .../APLSource/FilesAndDirs/HandlePath.aplf | 11 + .../APLSource/FilesAndDirs/History.apla | 47 + .../APLSource/FilesAndDirs/IsDir.aplf | 35 + .../APLSource/FilesAndDirs/IsFile.aplf | 23 + .../FilesAndDirs/IsSymbolicLink.aplf | 14 + .../APLSource/FilesAndDirs/ListDirs.aplf | 43 + .../APLSource/FilesAndDirs/ListFiles.aplf | 30 + .../APLSource/FilesAndDirs/MkDir.aplf | 36 + .../APLSource/FilesAndDirs/NCREATE.aplf | 3 + .../APLSource/FilesAndDirs/NGET.aplf | 28 + .../APLSource/FilesAndDirs/NNAMES.aplf | 5 + .../APLSource/FilesAndDirs/NPUT.aplf | 31 + .../APLSource/FilesAndDirs/NormalizePath.aplf | 50 ++ .../APLSource/FilesAndDirs/PWD.aplf | 5 + .../FilesAndDirs/PolishCurrentDir.aplf | 10 + .../FilesAndDirs/ProduceRandomName.aplf | 3 + .../APLSource/FilesAndDirs/Public.aplf | 37 + .../APLSource/FilesAndDirs/RmDir.aplf | 59 ++ .../APLSource/FilesAndDirs/RmDirByForce.aplf | 46 + .../APLSource/FilesAndDirs/Version.aplf | 3 + .../APLSource/FilesAndDirs/YoungerThan.aplf | 5 + .../APLSource/FilesAndDirs/quadVars.apln | 3 + .../aplteam-FilesAndDirs-5.6.0/LICENSE | 22 + .../apl-dependencies.txt | 2 + .../apl-package.json | 25 + tatin-packages_dev/apl-buildlist.json | 2 +- tatin-packages_dev/apl-dependencies.txt | 2 +- .../APLSource/APLTreeUtils2.aplc | 45 +- .../aplteam-APLTreeUtils2-1.3.0}/LICENSE | 2 +- .../apl-package.json | 4 +- .../APLSource/FilesAndDirs/ADOC_Doc.apla | 40 + .../FilesAndDirs/API/AddTrailingSep.aplf | 1 + .../APLSource/FilesAndDirs/API/Cd.aplf | 1 + .../APLSource/FilesAndDirs/API/CheckPath.aplf | 1 + .../FilesAndDirs/API/CurrentSep.aplf | 2 + .../FilesAndDirs/API/DateToReal.aplf | 1 + .../FilesAndDirs/API/DeleteFile.aplf | 1 + .../APLSource/FilesAndDirs/API/Dir.aplf | 1 + .../FilesAndDirs/API/EnforceBackslash.aplf | 1 + .../FilesAndDirs/API/EnforceSlash.aplf | 1 + .../FilesAndDirs/API/ExecNfunction.aplo | 1 + .../APLSource/FilesAndDirs/API/Exists.aplf | 1 + .../FilesAndDirs/API/ExpandPath.aplf | 1 + .../FilesAndDirs/API/GetModifiedDate.aplf | 1 + .../FilesAndDirs/API/GetNewLineCharsFor.aplf | 1 + .../FilesAndDirs/API/GetTempFilename.aplf | 1 + .../FilesAndDirs/API/GetTempFilename2.aplf | 1 + .../FilesAndDirs/API/GetTempPath.aplf | 2 + .../FilesAndDirs/API/GetTempSubDir.aplf | 1 + .../APLSource/FilesAndDirs/API/IsDir.aplf | 1 + .../APLSource/FilesAndDirs/API/IsFile.aplf | 1 + .../FilesAndDirs/API/IsSymbolicLink.aplf | 1 + .../APLSource/FilesAndDirs/API/ListDirs.aplf | 1 + .../APLSource/FilesAndDirs/API/ListFiles.aplf | 1 + .../APLSource/FilesAndDirs/API/MkDir.aplf | 1 + .../APLSource/FilesAndDirs/API/NCREATE.aplf | 1 + .../APLSource/FilesAndDirs/API/NGET.aplf | 1 + .../APLSource/FilesAndDirs/API/NNAMES.aplf | 2 + .../APLSource/FilesAndDirs/API/NPUT.aplf | 1 + .../FilesAndDirs/API/NormalizePath.aplf | 1 + .../APLSource/FilesAndDirs/API/PWD.aplf | 2 + .../FilesAndDirs/API/PolishCurrentDir.aplf | 2 + .../APLSource/FilesAndDirs/API/RmDir.aplf | 1 + .../FilesAndDirs/API/RmDirByForce.aplf | 1 + .../APLSource/FilesAndDirs/API/Version.aplf | 2 + .../FilesAndDirs/API/YoungerThan.aplf | 1 + .../FilesAndDirs/AddTrailingSep.aplf | 6 + .../APLSource/FilesAndDirs/Cd.aplf | 31 + .../APLSource/FilesAndDirs/CheckPath.aplf | 26 + .../APLSource/FilesAndDirs/CurrentSep.aplf | 3 + .../APLSource/FilesAndDirs/DateToReal.aplf | 3 + .../APLSource/FilesAndDirs/DeleteFile.aplf | 41 + .../APLSource/FilesAndDirs/Dir.aplf | 149 ++++ .../APLSource/FilesAndDirs/EncodeBlanks.aplf | 1 + .../FilesAndDirs/EnforceBackslash.aplf | 3 + .../APLSource/FilesAndDirs/EnforceSlash.aplf | 4 + .../APLSource/FilesAndDirs/ExecNfunction.aplo | 25 + .../APLSource/FilesAndDirs/Exists.aplf | 10 + .../APLSource/FilesAndDirs/ExpandPath.aplf | 3 + .../APLSource/FilesAndDirs/GetLastError.aplf | 10 + .../FilesAndDirs/GetModifiedDate.aplf | 3 + .../FilesAndDirs/GetMsgFromError.aplf | 32 + .../FilesAndDirs/GetNewLineCharsFor.aplf | 8 + .../FilesAndDirs/GetTempFilename.aplf | 40 + .../FilesAndDirs/GetTempFilename2.aplf | 28 + .../APLSource/FilesAndDirs/GetTempPath.aplf | 18 + .../APLSource/FilesAndDirs/GetTempSubDir.aplf | 25 + .../APLSource/FilesAndDirs/HandlePath.aplf | 11 + .../APLSource/FilesAndDirs/History.apla | 47 + .../APLSource/FilesAndDirs/IsDir.aplf | 35 + .../APLSource/FilesAndDirs/IsFile.aplf | 23 + .../FilesAndDirs/IsSymbolicLink.aplf | 14 + .../APLSource/FilesAndDirs/ListDirs.aplf | 43 + .../APLSource/FilesAndDirs/ListFiles.aplf | 30 + .../APLSource/FilesAndDirs/MkDir.aplf | 36 + .../APLSource/FilesAndDirs/NCREATE.aplf | 3 + .../APLSource/FilesAndDirs/NGET.aplf | 28 + .../APLSource/FilesAndDirs/NNAMES.aplf | 5 + .../APLSource/FilesAndDirs/NPUT.aplf | 31 + .../APLSource/FilesAndDirs/NormalizePath.aplf | 50 ++ .../APLSource/FilesAndDirs/PWD.aplf | 5 + .../FilesAndDirs/PolishCurrentDir.aplf | 10 + .../FilesAndDirs/ProduceRandomName.aplf | 3 + .../APLSource/FilesAndDirs/Public.aplf | 37 + .../APLSource/FilesAndDirs/RmDir.aplf | 59 ++ .../APLSource/FilesAndDirs/RmDirByForce.aplf | 46 + .../APLSource/FilesAndDirs/Version.aplf | 3 + .../APLSource/FilesAndDirs/YoungerThan.aplf | 5 + .../APLSource/FilesAndDirs/quadVars.apln | 3 + .../aplteam-FilesAndDirs-5.6.0/LICENSE | 22 + .../apl-dependencies.txt | 2 + .../apl-package.json | 25 + 196 files changed, 3379 insertions(+), 155 deletions(-) create mode 100644 APLSource/Admin/CreateUserCommandHelpForProofreading.aplf create mode 100644 APLSource/Cider/API/GetCiderAliasFileContent.aplf delete mode 100644 APLSource/Cider/API/GetProjectPath.aplf rename {tatin-packages/aplteam-APLTreeUtils2-1.2.0 => Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1}/APLSource/APLTreeUtils2.aplc (92%) rename Tests/Test_Open_051/packages/{aplteam-APLTreeUtils2-1.3.0 => aplteam-APLTreeUtils2-1.3.1}/LICENSE (100%) rename {tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0 => Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1}/apl-package.json (91%) create mode 100644 tatin-packages/APLGit2_UC.dyalog rename {Tests/Test_Open_051/packages => tatin-packages}/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc (100%) rename {tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0 => tatin-packages/aplteam-APLTreeUtils2-1.3.0}/LICENSE (96%) rename {Tests/Test_Open_051/packages => tatin-packages}/aplteam-APLTreeUtils2-1.3.0/apl-package.json (100%) create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EncodeBlanks.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EnforceBackslash.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EnforceSlash.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ExecNfunction.aplo create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Exists.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ExpandPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetLastError.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetModifiedDate.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetMsgFromError.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/HandlePath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/History.apla create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListFiles.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/MkDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NCREATE.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NGET.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/LICENSE create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt create mode 100644 tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-package.json rename tatin-packages_dev/{aplteam-APLTreeUtils2-1.2.0 => aplteam-APLTreeUtils2-1.3.0}/APLSource/APLTreeUtils2.aplc (93%) rename {tatin-packages/aplteam-APLTreeUtils2-1.2.0 => tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0}/LICENSE (96%) rename {tatin-packages/aplteam-APLTreeUtils2-1.2.0 => tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0}/apl-package.json (91%) create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EncodeBlanks.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EnforceBackslash.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/EnforceSlash.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ExecNfunction.aplo create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Exists.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ExpandPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetLastError.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetModifiedDate.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetMsgFromError.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/HandlePath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/History.apla create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListFiles.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/MkDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NCREATE.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NGET.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/LICENSE create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt create mode 100644 tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-package.json diff --git a/APLSource/Admin/CreateUserCommandHelpForProofreading.aplf b/APLSource/Admin/CreateUserCommandHelpForProofreading.aplf new file mode 100644 index 00000000..e12dc5f7 --- /dev/null +++ b/APLSource/Admin/CreateUserCommandHelpForProofreading.aplf @@ -0,0 +1,16 @@ + CreateUserCommandHelpForProofreading;cmdList;help2;help3 +⍝ Compiles all the help into a single file for easier proof-reading + cmdList←⎕SE.UCMD'Cider -??' + cmdList←(⎕UCS 13)(≠⊆⊢)cmdList + cmdList←(⍸∨/¨'CIDER:'∘⍷¨cmdList)↓cmdList + cmdList←(+/∧\(↑cmdList)[;1 2]∧.=' ')↑cmdList + cmdList←##.Cider.APLTreeUtils2.DLB cmdList + cmdList←{⍵↑⍨¨⍵⍳¨' '}cmdList + help2←{⎕SE.UCMD ⍵}¨cmdList,¨⊂' -??' + help2←{1<≡⍵:⍵ ⋄ (⎕UCS 13)(≠⊆⊢)⍵}¨help2 + help2←{⍵↓⍨(⊃⍵)∧.='─'}¨help2 + (1⊃¨help2)←(⊂'### '),¨1⊃¨help2 + help2←('# Cider Help' '## Level 2'),⊃,/help2 + help3←{⎕SE.UCMD ⍵}¨cmdList,¨⊂' -???' +∘∘∘ ⍝TODO⍝ ⍝TODO⍝ Work in progress +⍝Done diff --git a/APLSource/Cider/API/GetCiderAliasFileContent.aplf b/APLSource/Cider/API/GetCiderAliasFileContent.aplf new file mode 100644 index 00000000..1a6a20cd --- /dev/null +++ b/APLSource/Cider/API/GetCiderAliasFileContent.aplf @@ -0,0 +1 @@ + GetCiderAliasFileContent←{⍺←⊢ ⋄ ⍺ ##.GetCiderAliasFileContent ⍵} diff --git a/APLSource/Cider/API/GetProjectPath.aplf b/APLSource/Cider/API/GetProjectPath.aplf deleted file mode 100644 index d264560a..00000000 --- a/APLSource/Cider/API/GetProjectPath.aplf +++ /dev/null @@ -1 +0,0 @@ - GetProjectPath←{##.GetProjectPath ⍵} diff --git a/APLSource/Cider/CreateOpenParms.aplf b/APLSource/Cider/CreateOpenParms.aplf index a0e37ad2..423b632f 100644 --- a/APLSource/Cider/CreateOpenParms.aplf +++ b/APLSource/Cider/CreateOpenParms.aplf @@ -1,4 +1,4 @@ - parms←CreateOpenParms dummy;list;b;l + parms←CreateOpenParms y;list;b;l ⍝ Creates a namespace with all parameters one might pass to `OpenProject`.\\ ⍝ `y` might be an empty vector or a namespace with some such parameters. ⍝ Any parameters passed this way overwrite defaults. diff --git a/APLSource/Cider/History.apla b/APLSource/Cider/History.apla index 1dcc134f..72bd7dbf 100644 --- a/APLSource/Cider/History.apla +++ b/APLSource/Cider/History.apla @@ -3,6 +3,9 @@ ' * BREAKING CHANGE: API function `GetAliasFileContent` renamed: `GetCiderAliasFileContent`' ' * Optional property `tatinVars` added to the Cider config file and `InjectTatinVars` changed accordingly' ' * `CheckTargetNamespaceAndLinkFolder` improved in terms of error messages and better questions ' + ' * Documentation improved' + ' * New version of FilesAndDirs integrated which addresses the problem that RmDirByForce with ''/..'' dir not' + ' work on Linux and Mac OS.' ' * Bug fix in `InjectTatinVars`: TatinVars was injected into the project root rather than the package root' '* 0.37.5 ⋄ 2023-11-07' ' * Bug fixes' diff --git a/APLSource/TestCases/CheckTempDirForLeftOvers.aplf b/APLSource/TestCases/CheckTempDirForLeftOvers.aplf index 40c69f09..699c20ae 100644 --- a/APLSource/TestCases/CheckTempDirForLeftOvers.aplf +++ b/APLSource/TestCases/CheckTempDirForLeftOvers.aplf @@ -2,7 +2,7 @@ F←#.Cider.Cider.FilesAndDirs :If 0<≢list←F.ListDirs F.GetTempPath,'Cider-Tests*' :AndIf ~∨/'_Alias_'⍷testFnName ⍝ The group "Alias" cleans up in the Cleanup_Alias function - ⎕TRAP←0 'S' - ∘∘∘ +⍝ ⎕TRAP←0 'S' +⍝ ∘∘∘ :EndIf ⍝Done diff --git a/APLSource/TestCases/Initial_NuGet.aplf b/APLSource/TestCases/Initial_NuGet.aplf index 41e135b6..1027ce9d 100644 --- a/APLSource/TestCases/Initial_NuGet.aplf +++ b/APLSource/TestCases/Initial_NuGet.aplf @@ -1,10 +1,10 @@ - r←{x}Initial_NuGet ps;info + r←{x}Initial_NuGet ps;info;rc r←9=⎕NC'⎕SE.NuGet' info←'' :If ~r ⍝ ⎕se.NuGet not found and... info←'⎕SE.NuGet is not available, so the NuGet tests can not be executed.' ⍝ ... so we inform the user :EndIf - :Select ⊃1⊃2250⌶0 + :Select ⊃1⊃rc←2250⌶0 :Case ¯1 r←0 info←'.NET interface is not supported.' @@ -15,8 +15,12 @@ r←0 info←'The .NET interface is configured to use .NET Framework - incompatible with NuGet.' :EndSelect + :If 0=2⊃rc + info←'Could not load the .NET bridge interface.' + :EndIf :If ~ps.batchFlag :AndIf 0<≢info CommTools.Pause info,(⎕UCS 13),'Therefore the NuGet tests cannot be executed.' + r←0 :EndIf ⍝Done diff --git a/APLSource/TestCases/Test_OpenAndClose_001.aplf b/APLSource/TestCases/Test_OpenAndClose_001.aplf index eedf010c..1461f519 100644 --- a/APLSource/TestCases/Test_OpenAndClose_001.aplf +++ b/APLSource/TestCases/Test_OpenAndClose_001.aplf @@ -32,7 +32,7 @@ list←FilesAndDirs.ListFiles projectFolder2 →T.GoToTidyUp 1≠≢list →T.GoToTidyUp'cider.config'≢⊃,/1↓⎕NPARTS 1⊃list - aliase←##.Cider.GetCCiderAliasFileContent ⍬ + aliase←##.Cider.GetCiderAliasFileContent ⍬ →T.GoToTidyUp~∧/(⎕C'test-case-alias-Foo' 'test-case-alias-Goo')∊aliase[;1] →T.GoToTidyUp 1≠##.Cider.CloseProject'#.Foo' diff --git a/APLSource/TestCases/Test_UC_030.aplf b/APLSource/TestCases/Test_UC_030.aplf index 4a267e6f..116943ee 100644 --- a/APLSource/TestCases/Test_UC_030.aplf +++ b/APLSource/TestCases/Test_UC_030.aplf @@ -7,7 +7,7 @@ Delete_∆ALIAS_TEMP_FOLDER (rc msg res)←∆UCMD'ListAliases -prune -batch' Assert rc=0 - mat2←##.Cider.GetAliasFileContent ⍬ + mat2←##.Cider.GetCiderAliasFileContent ⍬ →T.PassesIf(+/~⎕NEXISTS mat1[;2])=-/≢¨mat1 mat2 R←T._OK diff --git a/Tests/Test_Open_051/packages/apl-buildlist.json b/Tests/Test_Open_051/packages/apl-buildlist.json index cc7635bf..e70f383b 100644 --- a/Tests/Test_Open_051/packages/apl-buildlist.json +++ b/Tests/Test_Open_051/packages/apl-buildlist.json @@ -1,6 +1,6 @@ { packageID: [ - "aplteam-APLTreeUtils2-1.3.0", + "aplteam-APLTreeUtils2-1.3.1", ], principal: [ 1, diff --git a/Tests/Test_Open_051/packages/apl-dependencies.txt b/Tests/Test_Open_051/packages/apl-dependencies.txt index a71f5a1a..078f6738 100644 --- a/Tests/Test_Open_051/packages/apl-dependencies.txt +++ b/Tests/Test_Open_051/packages/apl-dependencies.txt @@ -1 +1 @@ -aplteam-APLTreeUtils2-1.3.0 +aplteam-APLTreeUtils2-1.3.1 diff --git a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc b/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/APLSource/APLTreeUtils2.aplc similarity index 92% rename from tatin-packages/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc rename to Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/APLSource/APLTreeUtils2.aplc index e46ea021..8bf02235 100644 --- a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc +++ b/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/APLSource/APLTreeUtils2.aplc @@ -3,13 +3,13 @@ ⍝ While `APLTreeUtils` was a namespace scipt designed to be included into pretty much every member of the ⍝ APLTree library, `APLTreeUtils2` is a class with shared methods. You are supposed to call those methods. ⍝ This has some major advantageous over the old approach: -⍝ * It's possible to add new functions to `APLTreeUtils`. With the old approach there was always the possibility +⍝ * It's possible to add new functions to `APLTreeUtils2`. With the old approach there was always the possibility ⍝ of a name clash, so adding new function was practically impossible. ⍝ * The sequence of fixing does not matter (though with lazy fixing that should not be an issue anymore anyway, ⍝ but at the time of writing it still is). ⍝ * Over the years we have seen rare `⎕IO` and `⎕ML` issues with `:Include`. We just avoid the possibility now.\\ ⍝ For a list with the precise differences between `APLTreeUtils` and `APLTreeUtils2` see the project ReadMe on -⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires Dyalog 18.0. +⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires at least Dyalog 18.0. ⍝ Kai Jaeger\\ ⍝ Homepage: @@ -17,10 +17,20 @@ ∇ r←Version :Access Public Shared - r←'APLTreeUtils2' '1.2.0+62' '2023-05-08' + r←'APLTreeUtils2' '1.3.1+62' '2023-12-11' ∇ ∇ History + ⍝ * 1.3.1 from 2023-12-01 + ⍝ * `CreateUUID` required to set `⎕RL` due to the fact that the seed is the same in every new namespace. + ⍝ * 1.3.0 from 2023-11-05 + ⍝ * `ToNum` now accepts a left argument which is returned in case the right argument is an empty vector. + ⍝ * New methods: `BitsToInt` and `IntToBits` + ⍝ * 1.2.2 from 2023-10-09 + ⍝ * Minor fix in CreateUUID + ⍝ * License corrected + ⍝ * 1.2.1 from 2023-10-05 + ⍝ * Bug fix in `Create_UUID` ⍝ * 1.2.0 from 2023-05-08 ⍝ * Bug fix: version number corrected ⍝ * 1.1.4 from 2023-04-09 @@ -65,10 +75,16 @@ r←0 2∊⍨10|⎕DR y ∇ - ∇ r←ToNum y - ⍝ Transforms `y` into number(s) + ∇ r←{default}ToNum y + ⍝ Transforms `y` into number(s).\\ + ⍝ In case `y` is empty `default` is returned which defaults to ⍬ (empty numeric vector). :Access Public Shared - r←⊃(//)⎕VFI y + :If 0=≢y + :AndIf 0<⎕NC'default' + r←default + :Else + r←⊃(//)⎕VFI y + :EndIf ∇ ∇ r←IsScripted y @@ -297,11 +313,11 @@ r←3↑⊃'.'⎕WG'APLVersion' ∇ - ∇ r←Create_UUID;⎕RL + ∇ r←Create_UUID ⍝ Produces a UUID :Access Public Shared - ⎕RL←+/⎕TS - r←'-'@(+\9,3⍴5)⊢(⎕D,⎕C ⎕A)[?36⍴16] + ⎕RL[1]←⊂⍬ + r←'-'@(4+5×⍳4)⊢(⎕D,⎕C ⎕A)[4(9+|)@20⊢5@15?36⍴16] ∇ ∇ r←{type}Base64 txt;charset @@ -419,4 +435,18 @@ cats''∘four¨24 part 8 bits ⍵ } + ∇ r←BitsToInt y + ⍝ Unsigned + :Access Public Shared + r←(32⍴2)⊥⌽32↑y + ∇ + + + ∇ r←IntToBits y + ⍝ Unsigned + :Access Public Shared + r←⌽(32⍴2)⊤y + ∇ + + :EndClass diff --git a/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/LICENSE b/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/LICENSE similarity index 100% rename from Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/LICENSE rename to Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/LICENSE diff --git a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/apl-package.json b/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/apl-package.json similarity index 91% rename from tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/apl-package.json rename to Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/apl-package.json index a73f5156..a9f6aa6f 100644 --- a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/apl-package.json +++ b/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.1/apl-package.json @@ -1,7 +1,7 @@ { api: "APLTreeUtils2", assets: "", - date: 20230508.171103, + date: 20231210.133211, description: "General utilities required by most members of the APLTree library", documentation: "", files: "", @@ -21,5 +21,5 @@ tags: "tools,utilities", uri: "https://tatin.dev/", userCommandScript: "", - version: "1.2.0+68", + version: "1.3.1+76", } diff --git a/apl-package.json b/apl-package.json index 46ab8861..cb411940 100644 --- a/apl-package.json +++ b/apl-package.json @@ -20,5 +20,5 @@ tags: "project-management", tatin_version: "0.103.0", userCommandScript: "APLSource/Cider_UC.dyalog", - version: "0.38.0+656", + version: "0.38.0+659", } diff --git a/docs/Cider-API-Reference.md b/docs/Cider-API-Reference.md index 5ac78075..cabffe43 100644 --- a/docs/Cider-API-Reference.md +++ b/docs/Cider-API-Reference.md @@ -90,10 +90,10 @@ Returns the number of projects closed. ## CreateOpenParms ``` -parms←CreateOpenParms dummy +parms←CreateOpenParms y ``` -A monadic function that returns a namespace with default parameters required by the `OpenProject` function. The right argument is ignored. +A monadic function that returns a namespace with default parameters required by the `OpenProject` function. The right argument might be either an empty vector (which is ignored) or a namespace holding some of the parameters. In the latter case the values are copied over. ``` @@ -495,3 +495,4 @@ This can be just `1.2.3`, but it may be something like `1.2.3-beta-1+113` + diff --git a/docs/Cider-User-Guide.md b/docs/Cider-User-Guide.md index 5e31ed47..5e834401 100644 --- a/docs/Cider-User-Guide.md +++ b/docs/Cider-User-Guide.md @@ -52,11 +52,10 @@ Use the user command `]Activate` to activate both Cider and Tatin. Start with: ``` #### Version 18.0 and 18.2 - -Unlike 19.0, these versions come with neither Tatin nor Cider, so you first have to make sure that Tatin is installed and available, because Cider is a Tatin package and is loaded as such. - + Unlike 19.0, these versions come with neither Tatin nor Cider, so you first have to make sure that Tatin is installed and available, because Cider is a Tatin package and is loaded as such. + The document [Installing And Updating The Tatin Client](https://tatin.dev/Assets/docs/InstallingAndUpdatingTheTatinClient.html "Link to the document on https://tatin.dev") provides instructions for how to install Tatin on 18.0 and 18.2. - + Once Tatin is available, installing Cider is easy and straightforward, just issue this command: ``` @@ -77,7 +76,7 @@ C:\Users\<⎕AN>\Documents\Dyalog APL-64 18.2 Unicode Files\SessionExtensions\Ci /Users/<⎕AN>/dyalog.182U64.files/SessionExtensions/CiderTatin/Cider/ ``` -Once the folder `SessionExtensions/CiderTatin/Cider` is in place, any newly started version of Dyalog is aware of the user commands `]Cider.*`. +Once the folder `SessionExtensions/CiderTatin/Cider` is in place, any newly started version of Dyalog 18.2 Unicode is aware of the user commands `]Cider.*`. The API is not available yet at this point, but it will become available once a Cider user command is issued. For example, after issuing the following command the API will be available via `⎕SE.Cider`: @@ -85,13 +84,13 @@ The API is not available yet at this point, but it will become available once a ]Cider.Version ``` -I> Note that for Dyalog's user command framework to be able to identify Cider's user command script the folder must be made known to SALT. However, since Cider requires Tatin to be available this must have been done already. +I> Note that for Dyalog's user command framework to be able to identify Cider's user command script, the folder must be made known to SALT. However, since Cider requires Tatin to be available this must have been done already. I> I> You can check this by issuing the command I> I> `]SALT.Settings cmddir` I> -I> which lists all folders the user command framework will scan for user commands. The `SessionExtensions/CiderTatin/` folder must be among them, otherwise no Tatin user command would be available. +I> This command lists all folders the user command framework will scan for user commands. The `SessionExtensions/CiderTatin/` folder must be among them, otherwise no Tatin user command would be available. If that is not good enough for you, follow the instructions provided by the document [Installing And Updating The Tatin Client](https://tatin.dev/Assets/docs/InstallingAndUpdatingTheTatinClient.html#On-setupdyalog "Link to the document on https://tatin.dev") for how to achieve that for Tatin. @@ -136,25 +135,23 @@ You can update Cider to the latest version by issuing the following command: You must restart Dyalog in order to start using the new version. A> ### ]Cider.UpdateCider -A> +A> A> Note that due to a change of the target folder this command will only work when you use it to update version 0.37.1 or later. A> -A> ### Versions prior to 0.37.0 -A> -A> *In earlier versions of Cider the command cannot know about the new target folder and must therefore not be used.* +A> !> ### Versions prior to 0.37.0 +A> => *In earlier versions of Cider the command cannot know about the new target folder and must therefore not be used.* +A> => +A> => For that reason you are advised to delete the `Cider/` folder from you `MyUCMDs/` folder (which means un-installing it) and then install it into the correct folder; see above. A> -A> For that reason you are advised to delete the `Cider/` folder from you `MyUCMDs/` folder (which means un-installing it) and then install it into the correct folder. -A> -A> ### Versions 0.37.1 and 0.37.2 -A> -A> These versions installed into the new folder but with one level missing, therefore *you must not use* `]CiderUpdateCider`! -A> -A> For that reason you are advised to install again into the correct folder. -A> -A> The next time you use `]Cider.UpdateCider` it will remove Cider from the wrong folder. +A> !> ### Versions 0.37.1 and 0.37.2 +A> => These versions installed into the new folder but with one level missing, therefore *you must not use* `]CiderUpdateCider`! +A> => +A> => For that reason you are advised to install again into the correct folder. +A> => +A> => The next time you use `]Cider.UpdateCider` it will remove Cider from the wrong folder. #### Git - +` If you use Git for version control management, and you have the [Git Bash](https://git-scm.com/downloads "Link to the Git Bash download page") installed, then Cider uses the package [`APLGit2`](https://github.com/aplteam/APLGit2 "Link to APLGit2 on GitHub") for communicating with Git. For example, when a project carries a directory `.git/` then Cider knows that the project is version controlled with Git, and it therefore uses the API of `APLGit2` to display the Git status report for a project in the later stages of opening a project. @@ -163,15 +160,15 @@ For example, when a project carries a directory `.git/` then Cider knows that th #### Global configuration -Cider may have a global configuration file that can be used to define settings that effect all projects. It's named is `cider.json`, and it is referred to as the _global_ Cider config file. +Cider may have a global configuration file that can be used to define settings that effect _all_ projects. It's named is `cider.json`, and it is referred to as the _global_ Cider config file. -This file, if it exists, it situated in a folder `.cider` that lives in the user's home folder on all platforms. For example, for a user JohnDoe the path would be `C:\Users\JohnDoe\.cider` on Windows, on Linux it would be `/home/JohnDoe/.cider` etc. +This file, if it exists, it situated in a folder `.cider` that lives in the user's home folder on all platforms. For example, for a user JohnDoe the path would be `C:\Users\JohnDoe\.cider` on Windows, on Linux it would be `/home/JohnDoe/.cider`, and on the Mac it would be `/Users/JohnDoe/.cider`. This folder does not only host the global config file, it's also the place where the file with alias definitions (`aliase.txt`) is saved as well as the file `cider.config.template` which is used as a template (hence the name) whenever a new project is created. #### Project configuration -Every Cider project has a configuration file called `cider.config` which is saved in the root of the project's folder. +Every Cider project has a configuration file called `cider.config`, which is saved in the root of the project's folder. When a new project is created, a copy of the file `cider.config.template` is copied from the global configuration folder (see above) into the root of the new project. @@ -231,14 +228,14 @@ This section discusses the Cider-specific parameters in alphabetical order. ###### distributionFolder -Has no default. If it is not empty it is supposed to be a folder, usually relative to the root of the project. Tatin's `BuildPackage` function would use this property in order to save the resulting ZIP file in this folder in case no specific target folder was specified. +There is no default. If it is not empty it is supposed to be a folder, usually relative to the root of the project. Tatin's `BuildPackage` function would use this property in order to save the resulting ZIP file in this folder in case no specific target folder was specified. -If you create all your package ZIP files always in the same sub-folder of any project then you can define this in Cider's project config template file in order to make sure that it will always default to that folder name: Tatin's `BuildPackage` function, when not provided with a target folder, would check whether the project is managed by Cider and has a non-empty property `distributionFolder` defined, and if so take that as the target folder. +If you create all your package ZIP files always in the same sub-folder of any project, then you can define this in Cider's project config template file in order to make sure that it will always default to that folder name: Tatin's `BuildPackage` function, when not provided with a target folder, would check whether the project is managed by Cider and has a non-empty property `distributionFolder` defined, and if so take that as the target folder. ###### parent -Defaults to `#` but can be something like `⎕SE` or `#.MyNamespace1.MyNamespace2`. +Defaults to `#` but can be something like `⎕SE` or `#.MyNamespace1.MyNamespace2` etc. Note that all namespaces specified as `parent` _must already exist_, otherwise an error is thrown. @@ -302,9 +299,9 @@ dependencies_dev: { }, ``` -All packages in the sub-folder tatin-packages_dev/ are loaded into the sub-namespace `Testcases` +All packages in the sub-folder `tatin-packages_dev/` are loaded into the sub-namespace `Testcases` -However, note that you cannot have a sub-key "nuget" in "dependencies_dev". +However, note that you cannot have a sub-key `nuget` in `dependencies_dev` for the time being. This restriction is likely to be lifted in a future release. ###### init @@ -329,27 +326,27 @@ The purpose is to tell anybody not familiar with the project how to create a new #.Cider.Admin.Make 1 ⍝ Execute this for creating a new version ``` -The output is compiled from the config parameter values `CIDER.parent`, `CIDER.projectSpace` and `CIDER.make` and the comment is then added. +The output is compiled from the config parameter values `CIDER.parent`, `CIDER.projectSpace` and `CIDER.make`, and the comment is then added. -However, if the first non-white space character of `make` is a `]` its definition would just be printed to the session together with a comment because then it's obviously a user command. +However, if the first non-white space character of `make` is a `]`, its definition would just be printed to the session together with a comment because then it's obviously a user command. ###### project_url If not empty this is expected to be a URL pointing to, say, a GitHub project. For information only. -Note that Cider cooperates with the package [`APLGit2`](https://github.com/aplteam/APLGit2 title="Link to APLGit2 on GitHub") if that is available in `⎕SE`. `APLGit2` is an interface between Dyalog and Git, although some of its commands will only work when the project is hosted on GitHub. +Note that Cider comes with a package [`APLGit2`](https://github.com/aplteam/APLGit2 title="Link to APLGit2 on GitHub"). `APLGit2` is an interface between Dyalog and Git, although some of its commands will only work when the project is hosted on GitHub. -Some function of `APLGit2` must know the `owner` of a project on GitHub. Those functions will investigate project_url`: if that points to GitHub, the owner is established from its contents. +Some function of `APLGit2` must know the `owner` of a project on GitHub. Those functions will investigate `project_url`: if that points to GitHub, the owner is established from its contents. ###### tatinVars This property is optional, it may or may not exist. If it exists it must carry either `⎕THIS` or the name of a sub-namespace of the project. -* `⎕THIS` has the same effect as if the property would not exist at all. +* `⎕THIS` has the same effect as if the property would not exist at all -* Specifying a sub-namespace would tell Cider to inject `TatinVars` into that sub-namespace rather than the root of the project. +* Specifying a sub-namespace would tell Cider to inject `TatinVars` into that sub-namespace rather than the root of the project For details see [Injecting a namespace TatinVars](#). @@ -416,7 +413,7 @@ USER: { }, ```` -After opening the project into, say, `#.MyProject` the value is accessible via +After opening the project into, say, `#.MyProject`, the value is accessible via ``` #.MyProject.CiderConfig.USER.Foo @@ -430,14 +427,14 @@ Note that the contents of the file `cider.config` directs what exactly Cider is #### Creating a project space -The first step carried out by `]Cider.OpenProject` is to create a namespace with the name `projectSpace` as a child of `parent`, when `parent` defaults to `#` but may be something like `⎕SE` or `#.Foo.Goo` etc. +The first step carried out by `]Cider.OpenProject` is to create a namespace with the name `projectSpace` as a child of `parent`, when `parent` defaults to `#`, but may be something like `⎕SE` or `#.Foo.Goo` etc. The `parent` must exist while the `parentSpace` may or may not exist. If it does not, it is created. If it does already exist then: * In case the namespace and the folder are both empty Cider carries on * In case only the namespace is empty Cider carries on * In case only the folder is empty Cider carries on -* In case neither the namespace nor the folder is empty the user is asked whether she wants the namespace to be emptied; if not an error is thrown. +* In case neither the namespace nor the folder is empty, the user is asked whether she wants the namespace to be emptied; if not an error is thrown. #### Setting system variables @@ -448,7 +445,7 @@ It is important to set these variables before code is brought into the workspace If you need other system variables to carry specific values then you may add them to the `SYSVARS` section. -Note that the names are not case sensitive: whether the value for `⎕FR` is specified as "fr" or "FR" or "Fr" or "fR" does not matter. +Note that the names are not case sensitive; for example, whether the value for `⎕FR` is specified as "fr" or "FR" or "Fr" or "fR" does not matter. In case a setting in `SYSVARS` cannot be used for assigning a system variable a warning message will be printed to the session. @@ -456,7 +453,7 @@ A> ### System variables A> A> Feel free to save system variables in files like `⎕IO.apla` in your source folder. A> -A> That's another way to make sure that system variables are set as early as possible because LINK will establish the values of system variables defined in files before it attempts to bring code into the workspace. +A> That's another way to make sure that system variables are set as early as possible, because LINK will establish the values of system variables defined in files before it attempts to bring code into the workspace. #### Bringing the code into the workspace @@ -469,7 +466,7 @@ Note that from now on we will refer to: `{parent}.{projectSpace}` as _the root of a project_. -By default, a link is established between the root of the project and the folder. When you intend to work on the project (read: change the code) then this is the obvious thing to do. +By default, a Link is established between the root of the project and the folder. When you intend to work on the project (read: change the code) then this is the obvious thing to do. A> ### LINK's `watch` parameter A> @@ -478,7 +475,7 @@ A> A> You may set `watch` to "ns" or "dir" instead. Refer to the LINK documentation for details. -However, if you want to bring in the code as part of, say, an automated build process, then you don't want to establish a link, you just want to bring the code into the workspace. This can be achieved by specifying the `-import` flag. +However, if you want to bring in the code as part of, say, an automated build process, then you don't want to establish a Link, you just want to bring the code into the workspace. This can be achieved by specifying the `-import` flag. #### Check for empty package folders @@ -498,16 +495,16 @@ In case a Tatin installation folder defined in the Cider config file does not co #### Check for later packages versions -In case the project has Tatin packages installed in one or more folders the user will be asked whether she wants Cider to check for any later versions of any of the principal packages. This will only happen in case `importFlag` is 0. +In case the project has Tatin packages installed in one or more folders, the user will be asked whether she wants Cider to check for any later versions of any of the principal packages. This will only happen in case `importFlag` is 0. However, note that this is only true if you've loaded the package(s) from a Tatin Registry that is in your config file _and_ has a priority greater than 0. Refer to the Tatin documentation for details. -If `]Cider.OpenProject` discovers later packages it will ask the user whether these packages shall be re-installed with the `-update` flag set. This will happen independently for each package installation folder. +If `]Cider.OpenProject` discovers later packages it will ask the user whether these packages shall be re-installed. This will happen independently for each package installation folder. #### Loading Tatin packages -Your application or tool might depend on one or more Tatin[^tatin] packages. By assigning a folder hosting Tatin packages to the `tatin` sub-key in `dependencies` and potentially `dependencies_dev` you can make sure that Cider will load[^load_tatin_pkgs] those installed packages into the root of your project or the assigned sub-namespace. +Your application or tool might depend on one or more Tatin[^tatin] packages. By assigning a folder hosting Tatin packages to the `tatin` sub-key in `dependencies`, and potentially also `dependencies_dev`, you can make sure that Cider will load[^load_tatin_pkgs] those installed packages into the root of your project or the assigned sub-namespace. See the config properties `dependencies` and `dependencies_dev` for details. @@ -518,7 +515,7 @@ Your application or tool might depend on a NuGet[^nuget] package. By assigning a See the config property `dependencies` details. -Note that NuGet packages can currently become part of your application, but they cannot be loaded as development tools. This restriction might be lifted in a later release. +Note that NuGet packages can currently become part of your application, but they cannot be loaded as development tools. This restriction is likely to be lifted in a later release. #### Injecting a namespace `CiderConfig` @@ -543,12 +540,12 @@ A> What eventually will become a package might well be a sub-namespace of the pr A> A> If that is the case then injecting `TatinVars` into the root of the project would **_not_** give a developer the same conditions as if the package was loaded. A> -A> This can be addressed by adding a property `tatinVars` into the `CIDER` section of the Cider config file, holding the name of a sub-namespace `TatinVars` should be injected into. +A> This can be addressed by adding the optional property `tatinVars` into the `CIDER` section of the Cider config file, holding the name of a sub-namespace `TatinVars` should be injected into. #### Changing the current directory -At this point Cider checks the current (or working) directory. If it's different from the project's directory the user is asked whether she wants to change the current directory to the project's directory. +At this point Cider checks the current (or working) directory. If it's different from the project's directory, the user is asked whether she wants to change the current directory to the project's directory. #### Initialising a project (optional) @@ -573,7 +570,7 @@ This can be achieved by specifying the fully qualified name of a function that m The function may or may not return a result, but when it does the result will be discarded. -The fully qualified name of the function must go into the file that is returned by the function `GetCiderGlobalConfigFilename` which is available only via the API, not as a user command. This is the Cider config file, not a Cider project config file. +The fully qualified name of the function must go into the file that is returned by the function `GetCiderGlobalConfigFilename` which is available only via the API, not as a user command. This is the global Cider config file, not a Cider project config file. That file already contains a definition of the keyword `ExecuteAfterProjectOpen`, but it is empty: @@ -596,7 +593,11 @@ Note that you may use the `ignoreUserExec` flag to tell `OpenProject` to ignore Finally Cider checks whether there is a variables `ToDo` in the root of your project that is not empty. If that's the case then the contents of that variable is printed to the session. -You may use this to keep track of steps that need to be executed before the project can be commited or published etc. +You may use this to keep track ... + +* of steps that need to be executed before the project can be commited or published etc. +* keep track of a variable or a config property or a setting that has just been deprecated, but should be removed with the next major release +* you name it #### Git @@ -615,9 +616,9 @@ This requires at least a comma-separated list of Tatin packages to be added to a A second (optional) argument, if specified, must be either a path to a Cider project or a Cider project alias. -If the second argument is omitted Cider acts an any open project. If there is more than one project currently open the user is asked which one she wants to act on. +If the second argument is omitted, Cider acts on any open project. If there are multiple projects open, the user is asked which one she wants to act on. -If the dependencies are going to be part of the development tool the `-development` flag must be specified. +If the dependencies are development tools then the `-development` flag must be specified. ### AddNuGetDependencies @@ -625,9 +626,9 @@ This requires at least a comma-separated list of NuGet packages to be added to a A second (optional) argument, if specified, must be either a path to a Cider project or a Cider project alias. -If the second argument is omitted Cider acts an any open project. If there is more than one project currently open the user is asked which one she wants to act on. +If the second argument is omitted, Cider acts on any open project. If there are multiple projects open, the user is asked which one she wants to act on. -Note that NuGet packages cannot be added to a Cider project as development tools. +Note that NuGet packages cannot be added to a Cider project as development tools; this restriction is likely to be lifted in a later release. ### ListTatinDependencies @@ -685,7 +686,7 @@ An example: [^tatin]: _Tatin_ is a Dyalog APL package manager: -[^nuget]: NuGet is all about .NET packages: +[^nuget]: _NuGet_ is all about .NET packages: [^link]: _LINK_ is a tool designed to bring APL code into the workspace and keep it in sync with the files the code came from; see and @@ -697,3 +698,4 @@ An example: + diff --git a/docs/Contributing.md b/docs/Contributing.md index 133037fa..ae3c4faf 100644 --- a/docs/Contributing.md +++ b/docs/Contributing.md @@ -11,13 +11,13 @@ In ordert to contribute to Cider as a developer you need some pieces of information. -W> This document is work in progress +W> This document is work in progress but useful nevertheless. ## Design ### The user commands and the API -Cider consists of an API and a number of user commands. +Cider consists of an API and a user command script. A couple of principles: @@ -30,10 +30,10 @@ A couple of principles: **User commands...** -* print useful messages if something goes wrong (though they do throw errors in case of missing or invalid parameters +* print useful messages if something goes wrong (though they do throw errors in case of missing or invalid parameters) * They often do guess what the user is up to - For example, if no project is specified, they check whether there is a single Cider project open. If that's the case they act on that project. If multiple projects are open they question the user which one to act on. + For example, if no project is specified, they check whether there is a single Cider project open. If that's the case, they act on that project. If multiple projects are open they ask the user which one to act on. ## Developing @@ -45,9 +45,9 @@ When Cider is opened as a Cider project however, it asks the user whether a vari If such a variable exists and its values is not 0, then Cider's user command script establishes a reference not to `⎕SE.Cider` but to `#.Cider.Cider`. -The consequence of this is that when you change a function in the process of running it, it will be saved by Link _in the project_, and your changes are preserved. +The consequence of this is that when you change a function in the process of running it, it will be saved by Link _in the project_, meaning your changes are preserved. -In order to remind you what's happening Cider prints a warning to the session whenever a user command is executed: +In order to remind you what's happening, Cider prints a warning to the session whenever a user command is executed: ``` *** Warning: Code is executed in #.Cider.Cider rather than ⎕SE.Cider! @@ -59,7 +59,7 @@ The former value is re-established once the tests are done. ### Changing the script `Cider.dyalog` -For the following to work you must put the following into `config.dcfg` (see the "Installation and Configuration Guide" of Dyalog for your OS for details): +For the following to work you must put this into `config.dcfg` (see the "Installation and Configuration Guide" of Dyalog for your OS for details): ``` @@ -70,7 +70,7 @@ For the following to work you must put the following into `config.dcfg` (see the } ``` -This setting ensures that when you make changes to a user command script then those changes will be saved by Link, not as part of the project but in the folder is was loaded from by the user command framework. +This setting ensures that when you make changes to a user command script, then those changes will be saved by Link, not as part of the project but in the folder is was loaded from by the user command framework. *That means that after such a change the script in the project is not up-to-date anymore!* @@ -101,3 +101,4 @@ You may ask Cider for how to build a new version: + diff --git a/html/Cider-API-Reference.html b/html/Cider-API-Reference.html index 055546f2..a5d6dac3 100644 --- a/html/Cider-API-Reference.html +++ b/html/Cider-API-Reference.html @@ -5,12 +5,12 @@ Cider Reference - +
@@ -85,8 +85,8 @@

4. CloseProject

5. CreateOpenParms

-
parms←CreateOpenParms dummy
-

A monadic function that returns a namespace with default parameters required by the OpenProject function. The right argument is ignored.

+
parms←CreateOpenParms y
+

A monadic function that returns a namespace with default parameters required by the OpenProject function. The right argument might be either an empty vector (which is ignored) or a namespace holding some of the parameters. In the latter case the values are copied over.

 alias                 ''
  checkPackageVersions  ⍬
  folder                ''
diff --git a/html/Cider-User-Guide.html b/html/Cider-User-Guide.html
index 3ae1da6a..d88eea20 100644
--- a/html/Cider-User-Guide.html
+++ b/html/Cider-User-Guide.html
@@ -11,6 +11,30 @@
 @page{margin:25mm 20mm 25mm 20mm;}body{font-family:"Times New Roman", serif;font-size:14pt;line-height:1.2;}h1{font-size:170%;}h2{font-size:110%;}h3{font-size:110%;}h4{font-size:105%;}h5{font-size:100%;}h6{font-size:95%;}h1{margin:0 0 20pt 0;}h2{margin:15pt 0 3pt 0;}h3{margin:10pt 0 0pt 0;}h4{margin:10pt 0 0pt 0;}h5{margin:9pt 0 0pt 0;}h6{margin:9pt 0 0pt 0;}h1,h2,h3,h4,h5,h6{color:black;font-family:"Arial", "Sans";page-break-after:avoid;}h1 > code,h2 > code,h3 > code,h4 > code,h5 > code,h6 > code{font-size:100%;}h2{border-bottom:1pt solid Silver;padding-bottom:2pt;}.h_tag{page-break-after:avoid;break-after:avoid;}abbr[title]{border-bottom:0;text-decoration:none;}a{color:black;margin:0;padding:0;vertical-align:baseline;text-decoration:none;font-style:italic;}a.autoheader_anchor{text-decoration:none;font-style:normal;page-break-after:avoid;break-after:avoid;}ul{list-style-type:square;}ul, ol{padding:0;margin:0;margin-top:10pt;}li > ul,li > ol{padding-bottom:0;padding-top:0;}li{line-height:1.3;margin:2pt 5pt 2pt 13pt;}ul > li, ol > li{margin:0 0 0 15pt;}li ul{margin-left:5pt;}li ul,li ol{margin:0 3pt 0 3pt;}li p{padding:0;margin:2pt 0;line-height:1.3;}p,ul,ol{line-height:1.2;padding:3pt 0 0 0;margin:0;color:black;}ul,ol{margin-top:0;}pre{padding:3pt 6pt;margin:5pt 0;white-space:pre-wrap;background-color:#FAFAFA;border:1pt Silver solid;display:block;font-family:APLFont, monospace;page-break-inside:avoid;overflow:hidden;line-height:1;}pre code{background-color:#FAFAFA;color:Black;padding:0;margin:0;border:0;white-space:pre-wrap;overflow:hidden;}code{font-family:APLFont, monospace;line-height:1.2;font-size:12pt;color:#950000;padding:0 2pt;border:1pt solid silver;white-space:nowrap;margin:0 0.2em 0 0.2em;border-radius:5px;}table td + td{border-left:1pt solid silver;}table th + th{border-left:1pt solid silver;}th, td{padding:1pt 5pt;border:1pt solid silver;vertical-align:top;}table code{font-style:normal;padding-left:0;padding-right:0;}table{margin:0.75em 0;font-family:APLFont;font-size:12pt;padding:0;border:1pt solid silver;border-collapse:collapse;}li > table{margin:10pt 0 10pt 0;}tr{margin:20pt;}th{font-weight:bold;}tfoot td{font-weight:bold;}tbody tr:nth-child(even) td,thead tr th{border-bottom:1pt solid #949494;}blockquote{border-left:5pt solid silver;padding-left:5pt;margin:8pt 3pt 8pt 8pt;margin:0.5em 0.2em 0.5em 0.5em;}blockquote p{padding:0 0.25em;}nav{background-color:#f8f8f8;border:1pt solid Gray;width:auto;padding:5pt 5pt 5pt 0;margin:5pt 0;overflow:hidden;}nav ul{list-style-type:none;margin:6pt 0 3pt 0;padding:0;}nav ul li{margin-top:3pt;margin-bottom:3pt;}nav li p{margin:0;padding:0;line-height:1;margin:0;padding:0;}nav li{line-height:1;padding:0;margin-top:0;margin-bottom:0;margin-left:8pt;}dl{margin-top:0;margin-bottom:10pt;}dt{margin-top:10pt;margin-bottom:0;font-weight:800;page-break-inside:avoid;}dd{margin-top:2pt;}label#hide_toc_label{font-size:65%;}.toc-container{background-color:inherit;}.toc-container h3{margin:0 0 2pt 7pt;}[type="checkbox"]{display:none;}label{display:block;width:100%;height:1.1em;top:0;padding-left:10pt;}a.external_link::before{content:" 🔗 ";}a.bookmark_link::before{content:" ➯";}a.mailto_link::before{content:" ✉"}nav a.bookmark_link{font-style:normal;}nav p{margin-left:10pt;font-weight:bold;font-size:9pt;}nav a{font-style:normal;}nav a.bookmark_link::before{content:"";}div#footnotes_div a::before{content:"";}div#footnotes_div a{font-style:normal;}div#footnotes_div{page-break-inside:avoid;}@font-face{font-family:"APLFont";src:local("APL385 Unicode"), url("https://misc.aplteam.com/apl385.ttf") format("truetype");}.hide{display:none;}.print{display:block;}.red{color:red;}.center{text-align:center;margin:0 auto;}.left{text-align:left;margin-right:0;}.right{text-align:right;margin-left:0;}.avoid_page_break{page-break-inside:avoid;}.page_break_before{page-break-before:always;}div.leanpub{margin:10pt 0 10pt 8pt;page-break-inside:avoid;display:grid;grid-template-columns:auto 1fr;grid-gap:10pt;align-items:top;}div.leanpub_A{border:1pt solid black;background-color:#f9f9f9;padding:5pt;margin:10pt 0 10pt 0;page-break-inside:avoid;}div.leanpub h3,div.leanpub_A h3{font-size:1.2em;padding:3pt 0 0 0;margin:0;}div.leanpub h4,div.leanpub_A h4{font-size:1.1em;padding:3pt 0 0 0;margin:0;}div.leanpub h5,div.leanpub h5{font-size:1.0em;padding:3pt 0 0 0;margin:0;}div.leanpub_A h5,div.leanpub_A h5{font-size:1.0em;padding:3pt 0 0 0;margin:0;}div.leanpub img{padding:0;margin:0 10pt 2pt 0;}div.leanpub_A > p:first-child{padding-top:0;margin-top:0;}div.leanpub > div > h1:first-child{padding-top:5pt;}div.leanpub img{float:left;padding:0;margin:5pt 10pt 0 0;clear:both;}span.leanpub_code{font-weight:bold;}div.leanpub p{display:block;padding:3pt 0 0 0;margin:0;}div.leanpub p:first-child,div.leanpub h1:first-child,div.leanpub h2:first-child,div.leanpub h3:first-child,div.leanpub ul:first-child,div.leanpub ol:first-child{padding-top:0;}div.leanpub > div{margin-left:35pt;}sup{font-size:0.75em;line-height:0;position:relative;vertical-align:baseline;top:-0.4em;}pre[class*="language-"]{position:relative;margin:5pt 0;padding:1.75rem 0 1.75rem 1rem;}pre[class*="language-"] button{position:absolute;top:5pt;right:5pt;}div.accordion{padding:0;margin:0.5em 0;}div.accordion > div{border:1pt solid silver;padding:0.5em;margin:0 0;}div.accordion > div p,div.accordion > div ul,div.accordion > div ol,div.accordion > div img,div.accordion > div table{margin-block-end:0.1em;}summary{display:block;}div.collapsible{border:1pt solid silver;padding:0.5em;margin:0.5em 0;}div.collapsible p,div.collapsible ul,div.collapsible ol,div.collapsible img,div.collapsible table{margin-block-end:0.1em;}ul.checkboxes{list-style:none;margin-left:-2rem;padding-left:0;}li{padding-left:1rem;text-indent:0;}ul.checkboxes > li::before{content:"☐ ";}ul.checkboxes > li.checked::before{content:"☒ ";}pre > button{display:none;}#toc-toggle{display:none;}#main_nav h2{margin:0;padding:0.5em 1em;border-bottom:1pt solid silver;}}
 
 
+
+
 
 
 
@@ -184,16 +208,16 @@

2.2.2. Version 18.0 and 18.2

/home/<⎕AN>/dyalog.182U64.files/SessionExtensions/CiderTatin/Cider/ ⍝ Mac OS /Users/<⎕AN>/dyalog.182U64.files/SessionExtensions/CiderTatin/Cider/
-

Once the folder SessionExtensions/CiderTatin/Cider is in place, any newly started version of Dyalog is aware of the user commands ]Cider.*.

+

Once the folder SessionExtensions/CiderTatin/Cider is in place, any newly started version of Dyalog 18.2 Unicode is aware of the user commands ]Cider.*.

The API is not available yet at this point, but it will become available once a Cider user command is issued. For example, after issuing the following command the API will be available via ⎕SE.Cider:

]Cider.Version
Information
-

Note that for Dyalog's user command framework to be able to identify Cider's user command script the folder must be made known to SALT. However, since Cider requires Tatin to be available this must have been done already.

+

Note that for Dyalog's user command framework to be able to identify Cider's user command script, the folder must be made known to SALT. However, since Cider requires Tatin to be available this must have been done already.

You can check this by issuing the command

]SALT.Settings cmddir

-

which lists all folders the user command framework will scan for user commands. The SessionExtensions/CiderTatin/ folder must be among them, otherwise no Tatin user command would be available.

+

This command lists all folders the user command framework will scan for user commands. The SessionExtensions/CiderTatin/ folder must be among them, otherwise no Tatin user command would be available.

@@ -231,21 +255,39 @@

2.3. Updating Cider

]Cider.UpdateCider

Note that due to a change of the target folder this command will only work when you use it to update version 0.37.1 or later.

+
+
+

Versions prior to 0.37.0

+
+
+

In earlier versions of Cider the command cannot know about the new target folder and must therefore not be used.

-

For that reason you are advised to delete the Cider/ folder from you MyUCMDs/ folder (which means un-installing it) and then install it into the correct folder.

+

For that reason you are advised to delete the Cider/ folder from you MyUCMDs/ folder (which means un-installing it) and then install it into the correct folder; see above.

+
+
+
+
+
+

Versions 0.37.1 and 0.37.2

+
+
+

These versions installed into the new folder but with one level missing, therefore you must not use ]CiderUpdateCider!

For that reason you are advised to install again into the correct folder.

The next time you use ]Cider.UpdateCider it will remove Cider from the wrong folder.

+
+
+
-

If you use Git for version control management, and you have the Git Bash installed, then Cider uses the package APLGit2 for communicating with Git.

+

a href="https://github.com/aplteam/APLGit2" class="external_link" title="Link to APLGit2 on GitHub"> If you use Git for version control management, and you have the [Git Bash](https://git-scm.com/downloads "Link to the Git Bash download page") installed, then Cider uses the package [APLGit2` for communicating with Git<

For example, when a project carries a directory .git/ then Cider knows that the project is version controlled with Git, and it therefore uses the API of APLGit2 to display the Git status report for a project in the later stages of opening a project.

-

Cider may have a global configuration file that can be used to define settings that effect all projects. It's named is cider.json, and it is referred to as the global Cider config file.

-

This file, if it exists, it situated in a folder .cider that lives in the user's home folder on all platforms. For example, for a user JohnDoe the path would be C:\Users\JohnDoe\.cider on Windows, on Linux it would be /home/JohnDoe/.cider etc.

+

Cider may have a global configuration file that can be used to define settings that effect all projects. It's named is cider.json, and it is referred to as the global Cider config file.

+

This file, if it exists, it situated in a folder .cider that lives in the user's home folder on all platforms. For example, for a user JohnDoe the path would be C:\Users\JohnDoe\.cider on Windows, on Linux it would be /home/JohnDoe/.cider, and on the Mac it would be /Users/JohnDoe/.cider.

This folder does not only host the global config file, it's also the place where the file with alias definitions (aliase.txt) is saved as well as the file cider.config.template which is used as a template (hence the name) whenever a new project is created.

-

Every Cider project has a configuration file called cider.config which is saved in the root of the project's folder.

+

Every Cider project has a configuration file called cider.config, which is saved in the root of the project's folder.

When a new project is created, a copy of the file cider.config.template is copied from the global configuration folder (see above) into the root of the new project.

-

Has no default. If it is not empty it is supposed to be a folder, usually relative to the root of the project. Tatin's BuildPackage function would use this property in order to save the resulting ZIP file in this folder in case no specific target folder was specified.

-

If you create all your package ZIP files always in the same sub-folder of any project then you can define this in Cider's project config template file in order to make sure that it will always default to that folder name: Tatin's BuildPackage function, when not provided with a target folder, would check whether the project is managed by Cider and has a non-empty property distributionFolder defined, and if so take that as the target folder.

+

There is no default. If it is not empty it is supposed to be a folder, usually relative to the root of the project. Tatin's BuildPackage function would use this property in order to save the resulting ZIP file in this folder in case no specific target folder was specified.

+

If you create all your package ZIP files always in the same sub-folder of any project, then you can define this in Cider's project config template file in order to make sure that it will always default to that folder name: Tatin's BuildPackage function, when not provided with a target folder, would check whether the project is managed by Cider and has a non-empty property distributionFolder defined, and if so take that as the target folder.

-

Defaults to # but can be something like ⎕SE or #.MyNamespace1.MyNamespace2.

+

Defaults to # but can be something like ⎕SE or #.MyNamespace1.MyNamespace2 etc.

Note that all namespaces specified as parent must already exist, otherwise an error is thrown.

With the user command, this can be overwritten temporarily with, say:

]Cider.OpenProject {path} -parent=#.MyProjects
@@ -385,8 +427,8 @@
2.5.1.1.6. dependencies_dev
dependencies_dev: {
     tatin: "tatin-packages_dev=Testcases",
     },
-

All packages in the sub-folder tatin-packages_dev/ are loaded into the sub-namespace Testcases

-

However, note that you cannot have a sub-key “nuget” in “dependencies_dev”.

+

All packages in the sub-folder tatin-packages_dev/ are loaded into the sub-namespace Testcases

+

However, note that you cannot have a sub-key nuget in dependencies_dev for the time being. This restriction is likely to be lifted in a future release.

2.5.1.1.7. init
@@ -408,16 +450,16 @@
2.5.1.1.8. make

The purpose is to tell anybody not familiar with the project how to create a new version by entering:

      ]Cider.Make
 #.Cider.Admin.Make 1 ⍝ Execute this for creating a new version
-

The output is compiled from the config parameter values CIDER.parent, CIDER.projectSpace and CIDER.make and the comment is then added.

-

However, if the first non-white space character of make is a ] its definition would just be printed to the session together with a comment because then it's obviously a user command.

+

The output is compiled from the config parameter values CIDER.parent, CIDER.projectSpace and CIDER.make, and the comment is then added.

+

However, if the first non-white space character of make is a ], its definition would just be printed to the session together with a comment because then it's obviously a user command.

If not empty this is expected to be a URL pointing to, say, a GitHub project. For information only.

-

Note that Cider cooperates with the package APLGit2 if that is available in ⎕SE. APLGit2 is an interface between Dyalog and Git, although some of its commands will only work when the project is hosted on GitHub.

-

Some function of APLGit2 must know the owner of a project on GitHub. Those functions will investigate project_url`: if that points to GitHub, the owner is established from its contents.

+

Note that Cider comes with a package APLGit2. APLGit2 is an interface between Dyalog and Git, although some of its commands will only work when the project is hosted on GitHub.

+

Some function of APLGit2 must know the owner of a project on GitHub. Those functions will investigate project_url: if that points to GitHub, the owner is established from its contents.

This property is optional, it may or may not exist. If it exists it must carry either ⎕THIS or the name of a sub-namespace of the project.

    -
  • ⎕THIS has the same effect as if the property would not exist at all.
  • -
  • Specifying a sub-namespace would tell Cider to inject TatinVars into that sub-namespace rather than the root of the project.
  • +
  • ⎕THIS has the same effect as if the property would not exist at all
  • +
  • Specifying a sub-namespace would tell Cider to inject TatinVars into that sub-namespace rather than the root of the project

For details see Injecting a namespace TatinVars.

@@ -487,7 +529,7 @@
2.5.1.4. USER
}, } }, -

After opening the project into, say, #.MyProject the value is accessible via

+

After opening the project into, say, #.MyProject, the value is accessible via

#.MyProject.CiderConfig.USER.Foo
-

The first step carried out by ]Cider.OpenProject is to create a namespace with the name projectSpace as a child of parent, when parent defaults to # but may be something like ⎕SE or #.Foo.Goo etc.

+

The first step carried out by ]Cider.OpenProject is to create a namespace with the name projectSpace as a child of parent, when parent defaults to #, but may be something like ⎕SE or #.Foo.Goo etc.

The parent must exist while the parentSpace may or may not exist. If it does not, it is created. If it does already exist then:

  • In case the namespace and the folder are both empty Cider carries on
  • In case only the namespace is empty Cider carries on
  • In case only the folder is empty Cider carries on
  • -
  • In case neither the namespace nor the folder is empty the user is asked whether she wants the namespace to be emptied; if not an error is thrown.
  • +
  • In case neither the namespace nor the folder is empty, the user is asked whether she wants the namespace to be emptied; if not an error is thrown.
@@ -517,12 +559,12 @@

2.6.2. Setting system variables

In the next step ]Cider.OpenProject is going to set at least two system variables defined in the config file in the SYSVARS section of the INI file: ⎕IO and ⎕ML.

It is important to set these variables before code is brought into the workspace because bringing class scripts or namespace scripts into the workspace implies potentially the execution of code, and that code might well rely on the correct setting of those system variables.

If you need other system variables to carry specific values then you may add them to the SYSVARS section.

-

Note that the names are not case sensitive: whether the value for ⎕FR is specified as “fr” or “FR” or “Fr” or “fR” does not matter.

+

Note that the names are not case sensitive; for example, whether the value for ⎕FR is specified as “fr” or “FR” or “Fr” or “fR” does not matter.

In case a setting in SYSVARS cannot be used for assigning a system variable a warning message will be printed to the session.

System variables

Feel free to save system variables in files like ⎕IO.apla in your source folder.

-

That's another way to make sure that system variables are set as early as possible because LINK will establish the values of system variables defined in files before it attempts to bring code into the workspace.

+

That's another way to make sure that system variables are set as early as possible, because LINK will establish the values of system variables defined in files before it attempts to bring code into the workspace.

@@ -534,14 +576,14 @@

2.6.3. Bringing the code into

To achieve this Cider uses LINK[3].

Note that from now on we will refer to:

{parent}.{projectSpace} as the root of a project.

-

By default, a link is established between the root of the project and the folder. When you intend to work on the project (read: change the code) then this is the obvious thing to do.

+

By default, a Link is established between the root of the project and the folder. When you intend to work on the project (read: change the code) then this is the obvious thing to do.

LINK's watch parameter

By default Cider sets the watch parameter to “both”, meaning that changes in the workspace via the editor are saved to disk, and any changes on disk are brought into the workspace.

You may set watch to “ns” or “dir” instead. Refer to the LINK documentation for details.

-

However, if you want to bring in the code as part of, say, an automated build process, then you don't want to establish a link, you just want to bring the code into the workspace. This can be achieved by specifying the -import flag.

+

However, if you want to bring in the code as part of, say, an automated build process, then you don't want to establish a Link, you just want to bring the code into the workspace. This can be achieved by specifying the -import flag.

-

In case the project has Tatin packages installed in one or more folders the user will be asked whether she wants Cider to check for any later versions of any of the principal packages. This will only happen in case importFlag is 0.

+

In case the project has Tatin packages installed in one or more folders, the user will be asked whether she wants Cider to check for any later versions of any of the principal packages. This will only happen in case importFlag is 0.

However, note that this is only true if you've loaded the package(s) from a Tatin Registry that is in your config file and has a priority greater than 0. Refer to the Tatin documentation for details.

-

If ]Cider.OpenProject discovers later packages it will ask the user whether these packages shall be re-installed with the -update flag set. This will happen independently for each package installation folder.

+

If ]Cider.OpenProject discovers later packages it will ask the user whether these packages shall be re-installed. This will happen independently for each package installation folder.

-

Your application or tool might depend on one or more Tatin[1] packages. By assigning a folder hosting Tatin packages to the tatin sub-key in dependencies and potentially dependencies_dev you can make sure that Cider will load[4] those installed packages into the root of your project or the assigned sub-namespace.

+

Your application or tool might depend on one or more Tatin[1] packages. By assigning a folder hosting Tatin packages to the tatin sub-key in dependencies, and potentially also dependencies_dev, you can make sure that Cider will load[4] those installed packages into the root of your project or the assigned sub-namespace.

See the config properties dependencies and dependencies_dev for details.

Your application or tool might depend on a NuGet[2] package. By assigning a folder hosting NuGet packages to the nuget sub-key in dependencies you can make sure that Cider will load those installed packages into the root of your project or the assigned sub-namespace.

See the config property dependencies details.

-

Note that NuGet packages can currently become part of your application, but they cannot be loaded as development tools. This restriction might be lifted in a later release.

+

Note that NuGet packages can currently become part of your application, but they cannot be loaded as development tools. This restriction is likely to be lifted in a later release.

-

At this point Cider checks the current (or working) directory. If it's different from the project's directory the user is asked whether she wants to change the current directory to the project's directory.

+

At this point Cider checks the current (or working) directory. If it's different from the project's directory, the user is asked whether she wants to change the current directory to the project's directory.

Finally Cider checks whether there is a variables ToDo in the root of your project that is not empty. If that's the case then the contents of that variable is printed to the session.

-

You may use this to keep track of steps that need to be executed before the project can be commited or published etc.

+

You may use this to keep track …

+
    +
  • of steps that need to be executed before the project can be commited or published etc.
  • +
  • keep track of a variable or a config property or a setting that has just been deprecated, but should be removed with the next major release
  • +
  • you name it
  • +

This requires at least a comma-separated list of Tatin packages to be added to a project.

A second (optional) argument, if specified, must be either a path to a Cider project or a Cider project alias.

-

If the second argument is omitted Cider acts an any open project. If there is more than one project currently open the user is asked which one she wants to act on.

-

If the dependencies are going to be part of the development tool the -development flag must be specified.

+

If the second argument is omitted, Cider acts on any open project. If there are multiple projects open, the user is asked which one she wants to act on.

+

If the dependencies are development tools then the -development flag must be specified.

This requires at least a comma-separated list of NuGet packages to be added to a project.

A second (optional) argument, if specified, must be either a path to a Cider project or a Cider project alias.

-

If the second argument is omitted Cider acts an any open project. If there is more than one project currently open the user is asked which one she wants to act on.

-

Note that NuGet packages cannot be added to a Cider project as development tools.

+

If the second argument is omitted, Cider acts on any open project. If there are multiple projects open, the user is asked which one she wants to act on.

+

Note that NuGet packages cannot be added to a Cider project as development tools; this restriction is likely to be lifted in a later release.

3.3. ListTatinDependencies

@@ -727,7 +774,7 @@

3.4. ListNuGetDependencies

Footnotes

  1. Tatin is a Dyalog APL package manager: https://github.com/aplteam/Tatin

    -
  2. NuGet is all about .NET packages: https://en.wikipedia.org/wiki/NuGet

    +
  3. NuGet is all about .NET packages: https://en.wikipedia.org/wiki/NuGet

  4. LINK is a tool designed to bring APL code into the workspace and keep it in sync with the files the code came from; see https://github.com/dyalog/Link and https://dyalog.github.io/link

  5. Strictly speaking only references to the packages are injected into your application or tool. The actual packages are loaded into either #._tatin or ⎕SE._tatin

@@ -783,6 +830,22 @@

3.4. ListNuGetDependencies

} } + +// This makes sure that only one summary is open at any given time +const All_Details = document.querySelectorAll('details'); + +All_Details.forEach(deet=>{ + deet.addEventListener('toggle', toggleOpenOneOnly) +}) + +function toggleOpenOneOnly(e) { + if (this.open) { + All_Details.forEach(deet=>{ + if (deet!=this && deet.open) deet.open = false + }); + } +} + diff --git a/html/Contributing.html b/html/Contributing.html index 982008a7..c5cf4bbd 100644 --- a/html/Contributing.html +++ b/html/Contributing.html @@ -48,7 +48,7 @@

1. Overview

Warning
-

This document is work in progress

+

This document is work in progress but useful nevertheless.

@@ -62,7 +62,7 @@

2. Design

2.1. The user commands and the API

-

Cider consists of an API and a number of user commands.

+

Cider consists of an API and a user command script.

A couple of principles:

API functions…

    @@ -72,9 +72,9 @@

    2.1. The user commands and the API

    User commands…

      -
    • print useful messages if something goes wrong (though they do throw errors in case of missing or invalid parameters
    • +
    • print useful messages if something goes wrong (though they do throw errors in case of missing or invalid parameters)
    • They often do guess what the user is up to -

      For example, if no project is specified, they check whether there is a single Cider project open. If that's the case they act on that project. If multiple projects are open they question the user which one to act on.

    • +

      For example, if no project is specified, they check whether there is a single Cider project open. If that's the case, they act on that project. If multiple projects are open they ask the user which one to act on.

    -

    For the following to work you must put the following into config.dcfg (see the “Installation and Configuration Guide” of Dyalog for your OS for details):

    +

    For the following to work you must put this into config.dcfg (see the “Installation and Configuration Guide” of Dyalog for your OS for details):

    {
         Settings: {
             DYALOGSTARTUPKEEPLINK : 0,
         }
     }
    -

    This setting ensures that when you make changes to a user command script then those changes will be saved by Link, not as part of the project but in the folder is was loaded from by the user command framework.

    +

    This setting ensures that when you make changes to a user command script, then those changes will be saved by Link, not as part of the project but in the folder is was loaded from by the user command framework.

    That means that after such a change the script in the project is not up-to-date anymore!

    However, when a new version is build the code will check whether the two scripts differ, and if they do it will ask the user whether the later one should be copied over, ensuring that no code will be lost.

    diff --git a/tatin-packages/APLGit2_UC.dyalog b/tatin-packages/APLGit2_UC.dyalog new file mode 100644 index 00000000..6a4326f5 --- /dev/null +++ b/tatin-packages/APLGit2_UC.dyalog @@ -0,0 +1,825 @@ +:Class APLGit2_uc +⍝ User Command class for "APLGit2" +⍝ Kai Jaeger + + ⎕IO←1 ⋄ ⎕ML←1 + MinimumVersionOfDyalog←'18.0' + _errno←811 + + ∇ r←List;c ⍝ this function usually returns 1 or more namespaces (here only 1) + :Access Shared Public + r←⍬ + :If AtLeastVersion⊃(//)⎕VFI MinimumVersionOfDyalog + + c←⎕NS'' + c.Name←'Add' + c.Desc←'Executes the git "Add" commands' + c.Group←'APLGit2' + c.Parse←'1 -project=' + c._Project←0 + r,←c + + c←⎕NS'' + c.Name←'AddGitIgnore' + c.Desc←'Create a file .gitignore, or merge default values with existing one' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←0 + r,←c + + c←⎕NS'' + c.Name←'ListBranches' + c.Desc←'Lists all branches for a Git-managed project' + c.Group←'APLGit2' + c.Parse←'1s -a -r' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'ChangeLog' + c.Desc←'Takes an APL name and list all commits the object was part of' + c.Group←'APLGit2' + c.Parse←'1 -project=' + c._Project←0 + r,←c + + c←⎕NS'' + c.Name←'Commit' + c.Desc←'Performs a commit on the current branch' + c.Group←'APLGit2' + c.Parse←'1s -m= -add' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'CompareCommits' + c.Desc←'Compares two different commits' + c.Group←'APLGit2' + c.Parse←'2s -project= -use= -files' + c._Project←0 + r,←c + + c←⎕NS'' + c.Name←'Diff' + c.Desc←'Compares the working directory with HEAD' + c.Group←'APLGit2' + c.Parse←'1s -verbose' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'GetDefaultProject' + c.Desc←'Returns namespace and folder of the current default project, if any' + c.Group←'APLGit2' + c.Parse←'0' + c._Project←0 + r,←c + + c←⎕NS'' + c.Name←'GetTagOfLatestRelease' + c.Desc←'Returns the tag of the latest release' + c.Group←'APLGit2' + c.Parse←'1s -verbose -username=' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'GoToGitHub' + c.Desc←'For a project "Foo/Goo" this opens https://github.com/Foo/Goo' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'Init' + c.Desc←'Initialises a folder for managing it by Git' + c.Group←'APLGit2' + c.Parse←'1s -quiet' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'IsDirty' + c.Desc←'Reports whether there are uncommited changes' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'IsGitProject' + c.Desc←'Returns "yes" or "no" depending on whether there is a ./.git folder' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'Log' + c.Desc←'Shows the commit logs' + c.Group←'APLGit2' + c.Parse←'2s -verbose' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'NoOfUntrackedFiles' + c.Desc←'Returns the number of untracked files' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'OpenGitShell' + c.Desc←'Opens a Git shell for a Git managed project' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'RefLog' + c.Desc←'List reference log entries (RefLogs)' + c.Group←'APLGit2' + c.Parse←'1s -max= -all -branch= -project=' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'SetDefaultProject' + c.Desc←'Specifies the project to be used in case no project is specified' + c.Group←'APLGit2' + c.Parse←'1s' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'Squash' + c.Desc←'Squashes some commits in the current branch into a single one' + c.Group←'APLGit2' + c.Parse←'2s -m=' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'Status' + c.Desc←'Reports all untracked files and/or all uncommitted changes' + c.Group←'APLGit2' + c.Parse←'1s -short' + c._Project←1 + r,←c + + c←⎕NS'' + c.Name←'Version' + c.Desc←'Returns name, version number and version date as a three-element vector' + c.Group←'APLGit2' + c.Parse←'' + c._Project←0 + r,←c + :EndIf + ∇ + + ∇ r←Run(Cmd Args);folder;G;space;max;ns;msg;noOf;noProjectSelected + :Access Shared Public + :If 0=⎕SE.⎕NC'APLGit2' + {}⎕SE.Tatin.LoadDependencies(⊃⎕NPARTS ##.SourceFile)'⎕SE' + :EndIf + G←⎕SE.APLGit2 + :If (⊂⎕C Cmd)∊⎕C'Log' 'Squash' + :If 0≢Args._1 + :AndIf ~⊃⊃⎕VFI Args._1~'-' ⍝ Neither a positive integer nor "yyyy-mm-dd" + (r space folder)←GetSpaceAndFolder Cmd Args + :Else + ns←⎕NS'' + ns._1←0 + (r space folder)←GetSpaceAndFolder Cmd ns + :EndIf + :Else + (r space folder)←GetSpaceAndFolder Cmd Args + :EndIf + noProjectSelected←∧/space folder∊''⍬ + :Select ⎕C Cmd + :Case ⎕C'Add' + →noProjectSelected/0 + r←Add space folder Args + :Case ⎕C'AddGitIgnore' + →noProjectSelected/0 + r←AddGitIgnore folder + :Case ⎕C'ChangeLog' + →noProjectSelected/0 + r←ChangeLog space folder Args + :Case ⎕C'Commit' + →noProjectSelected/0 + r←Commit space folder Args + :Case ⎕C'CompareCommits' + →noProjectSelected/0 + r←CompareCommits space folder Args + :Case ⎕C'Diff' + →noProjectSelected/0 + r←Diff space folder Args + :Case ⎕C'GetDefaultProject' + r←GetDefaultProject ⍬ + :Case ⎕C'GetTagOfLatestRelease' + →noProjectSelected/0 + r←GetTagOfLatestRelease space folder Args + :Case ⎕C'RefLog' + →noProjectSelected/0 + r←RefLog space folder Args + :Case ⎕C'GoToGitHub' + :If 0=⎕NC'space' + :OrIf 0=≢space + r←GoToGitHub Args + :Else + r←space GoToGitHub Args + :EndIf + :Case ⎕C'Init' + →noProjectSelected/0 + r←Init space folder Args + :Case ⎕C'IsDirty' + →noProjectSelected/0 + r←IsDirty space folder Args + :Case ⎕C'IsGitProject' + →noProjectSelected/0 + r←IsGitProject space folder Args + :Case ⎕C'ListBranches' + →noProjectSelected/0 + r←ListBranches space folder Args + :Case ⎕C'Log' + →noProjectSelected/0 + r←Log space folder Args + :Case ⎕C'NoOfUntrackedFiles' + →noProjectSelected/0 + r←NoOfUntrackedFiles folder + :Case ⎕C'OpenGitShell' + {}OpenGitShell space folder Args + r←'' + :Case ⎕C'RefLog' + →noProjectSelected/0 + r←RefLog space folder Args + :Case ⎕C'SetDefaultProject' + r←G.SetDefaultProject{⍵/⍨0≠⍵}Args._1 + :Case ⎕C'Squash' + →noProjectSelected/0 + msg←''Args.Switch'm' + noOf←⊃(//)⎕VFI(⍕(1+∧/Args._1∊⎕D)⊃Args.(_2 _1)),' +0' + r←⍪folder Squash msg noOf + :Case ⎕C'Status' + →noProjectSelected/0 + r←⍪Status space folder Args + :Case ⎕C'Version' + r←⎕SE.APLGit2.Version + :Else + ∘∘∘ ⍝ Huh?! + :EndSelect + ∇ + + ∇ r←GetTagOfLatestRelease(project path args);username;wsPathRef;project;l + r←'' + :If 0≡args.username + wsPathRef←⍎{l←⎕SE.Cider.ListOpenProjects 0 ⋄ ⊃l[l[;2]⍳⊂⍵;]}path + username←{(¯1+≢⍵)⊃⍵}'/'(≠⊆⊢)wsPathRef.CiderConfig.CIDER.project_url + :Else + username←args.username + :EndIf + project←wsPathRef.CiderConfig.CIDER.projectSpace + r←args.verbose G.GetTagOfLatestRelease username project + ∇ + + ∇ r←AddGitIgnore folder + r←⎕SE.APLGit2.AddGitIgnore folder + ∇ + + ∇ r←Log(space folder args);parms;buff + parms←⎕NS'' + parms.verbose←args.verbose + parms.max←¯1 + parms.since←'' + parms(ProcessLogParms)←(1+0≡args._2)⊃args.(_2 _1) + r←parms G.Log folder + ∇ + + ∇ parms←parms ProcessLogParms data;max + :If 0≢data + :If {(10=≢⍵)∧∧/(({⊃⍵↑⍨1⌈≢⍵}1↑(⍵~'-')∊⎕D)('-'=⊃1↑∪⍵~⎕D))}data ⍝ Is it something like "1934-01-31"? + parms.since←data + :ElseIf ⊃⊃⎕VFI data ⍝ Max?! + :AndIf 0 not found on disk')Assert 0<≢folder + :ElseIf 2=Args.⎕NC'project' + :AndIf (,0)≢,Args.project + :AndIf 0<≢Args.project + (space folder)←GetSpaceAndFolder_ Args.project + :Else + (space folder)←G.EstablishProject'' + :EndIf + :If 0=≢space,folder + :If (⊂Cmd)∊'OpenGitShell' '' + folder←'.' + :Else + r←'No project provided/selected' + :EndIf + :ElseIf ~(⊂Cmd)∊'GoToGitHub' 'OpenGitShell' + ('<',folder,'> not found on disk')Assert ⎕NEXISTS folder + :EndIf + :EndIf + ∇ + + ∇ r←GetDefaultProject dummy + r←G.GetDefaultProject dummy + ∇ + + ∇ r←Diff(space folder args);filter + r←⍪args.verbose G.Diff folder + ∇ + + ∇ r←Add(space folder args);filter + 'Not a URL on GitHub'Assert 0<≢args._1 + filter←args._1 + 'Invalid filter'Assert 0<≢filter + {}filter G.Add folder + r←0 0⍴'' + ∇ + + ∇ r←{space}GoToGitHub args + 'Not a URL on GitHub'Assert 0<≢args._1 + :If 0=⎕NC'space' + r←⎕SE.APLGit2.GoToGitHub args._1 + :Else + r←⎕SE.APLGit2.GoToGitHub space + :EndIf + ∇ + + ∇ r←ChangeLog(space folder args);msg;name;⎕TRAP + name←args._1 + :If ~(⊃name)∊'#⎕' + name←(⍕space),'.',name + :EndIf + ('Not an APL object: ',name)Assert 0<⎕NC name + r←folder ⎕SE.APLGit2.ChangeLog name + ∇ + + ∇ r←GoToGithub(space folder args);msg + r←⎕SE.APLGit2.GoToGithub folder msg + ∇ + + ∇ r←Init(space folder args) + 'This folder is already managed by Git'Assert~⎕SE.APLGit2.IsGitProject folder + :If args.quiet + :OrIf ⎕SE.CommTools.YesOrNo'Sure that you want to make ',folder,' a Git-managed folder?' + r←args.quiet ⎕SE.APLGit2.Init folder + :EndIf + ∇ + + ∇ r←IsDirty(space folder args) + r←⎕SE.APLGit2.IsDirty folder + r←(r+1)⊃'Clean' 'Dirty' + ∇ + + ∇ r←NoOfUntrackedFiles folder + r←⎕SE.APLGit2.NoOfUntrackedFiles folder + ∇ + + ∇ r←IsGitProject(space folder args) + r←(1+⎕SE.APLGit2.IsGitProject folder)⊃'no' 'yes' + ∇ + + ∇ r←OpenGitShell(space folder args) + r←⎕SE.APLGit2.OpenGitShell folder + ∇ + + ∇ r←RefLog(space folder args);branch;value;flag + :If (,0)≡args.branch + branch←'' + :Else + branch←args.branch + :EndIf + :If (,0)≡,args.max + r←folder ⎕SE.APLGit2.RefLog~args.all + :Else + r←folder ⎕SE.APLGit2.RefLog 0 + (flag value)←⎕VFI args.max + '"max" must be a positive integer'Assert flag + r←value↑r + :EndIf + ∇ + + ∇ r←Commit(space folder args);msg;ref;branch;rc;data;flag + branch←⎕SE.APLGit2.CurrentBranch folder + :If 0<⎕SE.APLGit2.NoOfUntrackedFiles folder + :If 1=args.add + :OrIf 1 ⎕SE.CommTools.YesOrNo'Branch "',branch,'" has unstaged changes etc - shall Git''s "Add -A" command be executed?' + (rc msg data)←folder ⎕SE.APLGit2.##.U.RunGitCommand'add -A' + msg Assert 0=rc + :Else + r←'Cancelled by user' + :Return + :EndIf + :EndIf + :If ⎕SE.APLGit2.IsDirty folder + :If (,0)≢,Args.m + :AndIf 0<≢Args.m + msg←Args.m + :Else + flag←0 + :Repeat + ref←⎕NS'' + ref.msg←,⊂'' + ref.⎕ED'msg' + msg←ref.msg{⍺/⍨~(⌽∧\0=⌽⍵)∨(∧\0=⍵)}≢¨ref.msg + :If (⊂branch)∊'main' 'master' + :AndIf 0=≢(∊msg)~'.' + :If 0=1 ⎕SE.CommTools.YesOrNo'You MUST specify a meaningful message for "',branch,'"; try again (no=cancel) ?' + r←'Commit cancelled by user' + :Return + :EndIf + :ElseIf 0<≢(∊msg)~'.' + :OrIf ⎕SE.CommTools.YesOrNo'Sure you don''t want to provide a message? ("No" cancells the whole operation)' + flag←1 + :Else + r←'Operation cancelled by user' + :Return + :EndIf + msg←{0=≢⍵:'...' ⋄ ⍵}msg + msg←1↓⊃,/(⎕UCS 10),¨⊆msg + :Until flag + :EndIf + r←⍪msg ⎕SE.APLGit2.Commit folder + :Else + r←'Nothing to commit, is clean' + :EndIf + ∇ + + ∇ r←Status(space folder args);short + short←Args.Switch'short' + r←short G.Status folder + ∇ + + ∇ r←folder Squash(msg noOf) + 'Number of commits to be squashed must be a positive integer'Assert(⎕DR noOf)∊83 163 323 + 'Number of commits to be squashed must be a positive integer'Assert noOf≥0 + r←folder G.Squash msg noOf + ∇ + + ∇ r←ListBranches(space folder args);parms + :If (,0)≢,args.a + parms←'-a' + :ElseIf (,0)≢,args.r + parms←'-r' + :Else + parms←'' + :EndIf + r←⍪parms G.ListBranches folder + ∇ + + ∇ r←level Help Cmd;ref;⎕TRAP + :Access Shared Public + r←'' + :Select level + :Case 0 + :Select ⎕C Cmd + :Case ⎕C'Add' + r,←⊂']APLGit2.add -project=' + :Case ⎕C'AddGitIgnore' + r,←⊂']APLGit2.AddGitIgnore [space|folder]' + :Case ⎕C'ChangeLog -project=' + r,←⊂']APLGit2.ChangeLog -project=' + :Case ⎕C'Commit' + r,←⊂']APLGit2.Commit [space|folder] -m= -add' + :Case ⎕C'CompareCommits' + r,←⊂']APLGit2.CompareCommits [hash1] [hash2] -project= -use=[name|?] -view' + :Case ⎕C'CurrentBranch' + r,←⊂']APLGit2.CurrenBranch [space|folder]' + :Case ⎕C'Diff' + r,←⊂']APLGit2.Diff [space|folder] -verbose' + :Case ⎕C'GetDefaultProject' + r,←⊂']GetDefaultProject' + :Case ⎕C'GetTagOfLatestRelease' + r,←⊂']APLGit2.GetTagOfLatestRelease [space|folder]' + :Case ⎕C'GoToGitHub' + r,←⊂']APLGit2.OpenGitHub [space|folder|/|[alias]]' + :Case ⎕C'Init' + r,←⊂']APLGit2.Init [folder] -quiet' + :Case ⎕C'IsDirty' + r,←⊂']APLGit2.IsDirty [space|folder]' + :Case ⎕C'IsGitProject' + r,←⊂']APLGit2.IsGitProject [space|folder]' + :Case ⎕C'ListBranches' + r,←⊂']APLGit2.ListBranches [space|folder] -a -r' + :Case ⎕C'Log' + r,←⊂']APLGit2.Log [space|folder] -since= -verbose -max=' + :Case ⎕C'NoOfUntrackedFiles' + r,←⊂']APLGit2.NoOfUntrackedFiles [space|folder]' + :Case ⎕C'OpenGitShell' + r,←⊂']APLGit2.OpenGitShell [space|folder]' + :Case ⎕C'RefLog' + r,←⊂']APLGit2.RefLog [space|folder] -max= -all -branch= -project=' + :Case ⎕C'SetDefaultProject' + r,←⊂']APLGit2.SetDefaultProject [space|folder]' + :Case ⎕C'Status' + r,←⊂']APLGit2.Status -short -path=' + :Case ⎕C'Squash' + r,←⊂']APLGit2.Squash [space|folder] [noOf] -m=' + :Else + r,←⊂'There is no help available' + :EndSelect + :If 'Version'≢Cmd + r,←''(']APLGit2.',Cmd,' -?? ⍝ Enter this for more information ') + :EndIf + + :Case 1 + :Select ⎕C Cmd + :Case ⎕C'Add' + r,←⊂'Add files to the index.' + r,←⊂'' + r,←⊂'You may specify one of:' + r,←⊂' * A file' + r,←⊂' * A folder' + r,←⊂' * A "." (dot), meaning that all so far untracked files should be added' + r,←⊂'' + r,←AddLevel3HelpInfo'Add' + :Case ⎕C'AddGitIgnore' + r,←⊂'Add a file .gitignore to a particular path or project, or merges an existing file with' + r,←⊂'default values.' + r,←⊂'' + r,←⊂'The user will be asked a couple of questions, and she will be able to edit the result' + r,←⊂'of her choices before it is written to file.' + :Case ⎕C'ChangeLog' + r,←⊂'Takes an APL name and returns a matrix with zero or more rows and 4 columns with' + r,←⊂'information regarding all commits the given APL object was changed:' + r,←⊂' 1. Hash' + r,←⊂' 2. Commiter''s name' + r,←⊂' 3. Date of the commit date in strict ISO 8601 format' + r,←⊂' 4. Message of the commit' + :Case ⎕C'Commit' + r,←⊂'Record changes to the repository.' + r,←⊂'There should not be any untracked files, but if there are anyway the user will be asked' + r,←⊂'whether she wants to add additions, changes & deletions first, read execute: "add -A"' + r,←⊂'' + r,←⊂'-add When the project is dirty then without the -add flag the user will be questioned' + r,←⊂' whether a "git add -A" command should be issued first. -add tells the user command' + r,←⊂' to do that in any case, without questioning the user.' + r,←⊂'' + r,←⊂'-m= If this is specified it is accepted as the message.' + r,←⊂' If it is not specified then the command will open an edit window for the message.' + r,←⊂'' + r,←⊂'Note that a message is epected for the "main" (or the now deprecated "master") branch but' + r,←⊂'the user will be asked if there is none anyway. Empty messages will become "...".' + r,←⊂'' + r,←AddLevel3HelpInfo'Commit' + :Case ⎕C'CompareCommits' + r,←⊂'Compare changes between two commits.' + r,←⊂'' + r,←⊂'You may specify none, one or two hashes as argument:' + r,←⊂' * No argument means "compare last commit with the most recent ancestor' + r,←⊂' * One argument means "compare last commit with the given commit"' + r,←⊂' * Two arguments mean "compare those commits with each other"' + r,←⊂'' + r,←⊂'If the user command ]CompareFiles and its API are available then this is used' + r,←⊂'for the comparison. Otherwise the names of two files are printed to session.' + r,←⊂'These files are generated in the temporary folder of the current OS.' + r,←⊂'' + r,←⊂'-files If the user command ]CompareFiles is available but you want to get just the' + r,←⊂' filenames specify this modifier' + r,←⊂'-use= If the user command ]CompareFiles is available then you can use this to' + r,←⊂' specify the comparison utility to be used. Must be either a name or a "?".' + r,←⊂' See ]CompareFiles for details.' + r,←⊂'-project= Use this to specify a particular project with -project=[ProjectName|ProjectFolder]' + r,←⊂'' + r,←⊂' * If there is just one open Cider project it is taken' + r,←⊂' * If there are several open Cider projects the user is interrogated' + r,←⊂' * You may specify a particular project with -project=[ProjectName|ProjectFolder]' + :Case ⎕C'CurrentBranch' + r,←⊂'Returns the name of the current branch' + r,←⊂'' + r,←AddLevel3HelpInfo'CurrentBranch' + :Case ⎕C'Diff' + r,←⊂'Returns a list of files in the working directory that are different from HEAD.' + r,←⊂'' + r,←⊂'-verbose: Specify this to get a full report' + r,←⊂'' + r,←AddLevel3HelpInfo'Diff' + :Case ⎕C'GetDefaultProject' + r,←⊂'Returns the namespace and the folder if there is a default project defined.' + r,←⊂'See also ]APLGit2.SetDefaultProject' + :Case ⎕C'GoToGitHub' + r,←⊂'Opens project in your default browser as, say:' + r,←⊂'https://github.com/aplteam/APLGit2' + r,←⊂'' + r,←⊂'The required project can be specified in a number of ways:' + r,←⊂' * A URL like https://github.com/aplteam.APLGit2' + r,←⊂' * A group and a project name like aplteam-APLGit2' + r,←⊂' * A fully qualified namespace name of an opened Cider project like' + r,←⊂' #.APLGit2' + r,←⊂' * A Cider alias of an opened Cider project like [git]' + r,←AddLevel3HelpInfo'GoToGitHub' + :Case ⎕C'Init' + r,←⊂'Useful to initialize a folder for being managed by Git.' + r,←⊂'' + r,←⊂'You may add the path to a folder as argument; if you do not then APLGit2 tries to' + r,←⊂'figure it out.' + r,←⊂'' + r,←⊂'-quiet is useful to prevent Init to ask any questions, mostly for tests.' + :Case ⎕C'IsDirty' + r,←⊂'Returns one of:' + r,←⊂' * "Clean"' + r,←⊂' * "Dirty"' + r,←⊂'' + r,←AddLevel3HelpInfo'IsDirty' + :Case ⎕C'IsGitProject' + r,←⊂'Returns:' + r,←⊂'Project (+\⍵='.'}2⊃'.'⎕WG'aplversion' + 'Right argument must be length 1'⎕SIGNAL _errno/⍨1≠≢min + r←⊃min≤currentVersion + ∇ + + Assert←{⍺←'' ⋄ (,1)≡,⍵:r←1 ⋄ (∊⍺) ⎕SIGNAL 1↓(⊃∊⍵),_errno} + + ∇ r←r AddTitles titles + ⍝ `r` is a matrix with data. `titles` is put on top of that matrix, followed by a row with `-` matching the lengths of each title + r←⍉↑(⊂¨titles),¨' ',¨↓⍉r + r[2;]←(≢¨r[1;])⍴¨'-' + ∇ + + ∇ path←AddSlash path + path,←(~(¯1↑path)∊'/\')/'/' + ∇ + + ∇ (space folder)←GetSpaceAndFolder_ data + :If ∨/'/\:'∊data + :OrIf ~(⊃data)∊'#⎕' + folder←data + space←G.GetProjectFromPath folder + :Else + space←data + folder←G.GetPathFromProject space + :EndIf + ∇ + +:EndClass diff --git a/tatin-packages/apl-buildlist.json b/tatin-packages/apl-buildlist.json index 78258431..0d3e6e06 100644 --- a/tatin-packages/apl-buildlist.json +++ b/tatin-packages/apl-buildlist.json @@ -1,6 +1,6 @@ { packageID: [ - "aplteam-FilesAndDirs-5.5.1", + "aplteam-FilesAndDirs-5.6.0", "aplteam-CommTools-1.7.1", "aplteam-APLTreeUtils2-1.3.1", "aplteam-APLGit2-0.15.4", diff --git a/tatin-packages/apl-dependencies.txt b/tatin-packages/apl-dependencies.txt index 0aaa27df..9a5d74da 100644 --- a/tatin-packages/apl-dependencies.txt +++ b/tatin-packages/apl-dependencies.txt @@ -1,4 +1,4 @@ aplteam-APLTreeUtils2-1.3.1 -aplteam-FilesAndDirs-5.5.1 +aplteam-FilesAndDirs-5.6.0 aplteam-CommTools-1.7.1 aplteam-APLGit2-0.15.4 diff --git a/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc b/tatin-packages/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc similarity index 100% rename from Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc rename to tatin-packages/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc diff --git a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/LICENSE b/tatin-packages/aplteam-APLTreeUtils2-1.3.0/LICENSE similarity index 96% rename from tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/LICENSE rename to tatin-packages/aplteam-APLTreeUtils2-1.3.0/LICENSE index bbb529f2..9f8bb329 100644 --- a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/LICENSE +++ b/tatin-packages/aplteam-APLTreeUtils2-1.3.0/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 APL Team Ltd +Copyright (c) 2018-2023 Kai Jaeger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/apl-package.json b/tatin-packages/aplteam-APLTreeUtils2-1.3.0/apl-package.json similarity index 100% rename from Tests/Test_Open_051/packages/aplteam-APLTreeUtils2-1.3.0/apl-package.json rename to tatin-packages/aplteam-APLTreeUtils2-1.3.0/apl-package.json diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla new file mode 100644 index 00000000..7aad1867 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla @@ -0,0 +1,40 @@ +( + '## Overview' + '' + 'This package provides functions that are useful for dealing with files and directories. ' + 'They aim to be platform-independent.\\' + 'Note that error codes and messages may differ between operating systems for the same' + 'type of problem.\\' + '' + '## Characters to avoid in file names and paths' + 'Windows filenames cannot contain any of these characters: `\/:*?"<>|`.' + 'If you want platform-independent code, now or in the future,' + 'avoid using them even in Mac OS or Linux filenames.\\' + '' + '## Separators in file paths' + 'Dyalog tried to ease the pain by converting any `\` character into `/` on Windows.' + 'The idea of sticking always with the `/` as separator because it works anyway is' + 'attractive, but it creates new poblems: when you use third-party software such as a .NET' + 'assembly or an EXE like 7zip.exe on Windows, then you **must** use `\` as a separator.' + 'Even setting the `Directory` property of a `FileBox` object will fail with `/` as the separator.\\' + 'For platform independence it is essential that filenames and directory names are _normalized_.' + 'This means using the correct separator for the current operating system.' + 'Otherwise you could create a directory or file with a backslash in its name, which is disastrous' + 'on Linux or Mac OS.\\' + 'The `FilesAndDirs` functions protect you from this problem by normalizing your file paths.' + 'Use cover functions like `MkDir`, `NNAMES` and `NCREATE` etc. instead of the built-in system ' + 'functions to overcome the problem.\\' + '`⎕NCOPY` and `⎕NMOVE` (introduced in 17.0) are exceptions, but you can use the native function' + 'with the `ExecNfunction` operator.' + 'The `CurrentSep` method returns the correct separator for the current operating system.\\' + 'The `NormalizePath` method normalizes a file path for the current operating system.\\' + 'If you have a particular reason for using `/` under Windows or `\` under Linux' + 'or Mac OS then you can use the `EnforceBackslash` or `EnforceSlash` functions.\\' + '' + '## Misc' + 'This class supports Windows, Mac OS and Linux but neither the Raspberry Pi nor AIX.' + '' + 'Kai Jaeger' + '' + 'Homepage: ' +) diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf new file mode 100644 index 00000000..0d45ffda --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf @@ -0,0 +1 @@ + AddTrailingSep←{⍺←⊢ ⋄ ⍺ ##.AddTrailingSep ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf new file mode 100644 index 00000000..519d9e81 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf @@ -0,0 +1 @@ + Cd←{##.Cd ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf new file mode 100644 index 00000000..4f463d63 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf @@ -0,0 +1 @@ + CheckPath←{⍺←⊢ ⋄ 1:shy←⍺ ##.CheckPath ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf new file mode 100644 index 00000000..ee24255d --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf @@ -0,0 +1,2 @@ + r←CurrentSep + r←##.CurrentSep diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf new file mode 100644 index 00000000..cca3ff56 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf @@ -0,0 +1 @@ + DateToReal←{##.DateToReal ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf new file mode 100644 index 00000000..b86efa66 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf @@ -0,0 +1 @@ + DeleteFile←{1:shy←##.DeleteFile ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf new file mode 100644 index 00000000..41866639 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf @@ -0,0 +1 @@ + Dir←{⍺←⊢ ⋄ ⍺ ##.Dir ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf new file mode 100644 index 00000000..9f84601e --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf @@ -0,0 +1 @@ + EnforceBackslash←{##.EnforceBackslash ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf new file mode 100644 index 00000000..2e896e42 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf @@ -0,0 +1 @@ + EnforceSlash←{##.EnforceSlash ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo new file mode 100644 index 00000000..84cef47b --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo @@ -0,0 +1 @@ + ExecNfunction←{⍺←⊢ ⋄ 1:shy←⍺(⍺⍺ ##.ExecNfunction)⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf new file mode 100644 index 00000000..3b4c5e31 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf @@ -0,0 +1 @@ + Exists←{##.Exists ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf new file mode 100644 index 00000000..94ed6614 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf @@ -0,0 +1 @@ + ExpandPath←{##.ExpandPath ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf new file mode 100644 index 00000000..bcfc65ba --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf @@ -0,0 +1 @@ + GetModifiedDate←{##.GetModifiedDate ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf new file mode 100644 index 00000000..6ec9f255 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf @@ -0,0 +1 @@ + GetNewLineCharsFor←{##.GetNewLineCharsFor ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf new file mode 100644 index 00000000..b997c427 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf @@ -0,0 +1 @@ + GetTempFilename←{⍺←⊢ ⋄ ⍺ ##.GetTempFilename ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf new file mode 100644 index 00000000..979e2590 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf @@ -0,0 +1 @@ + GetTempFilename2←{⍺←⊢ ⋄ ⍺ ##.GetTempFilename2 ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf new file mode 100644 index 00000000..c885179b --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf @@ -0,0 +1,2 @@ + path←GetTempPath + path←##.GetTempPath diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf new file mode 100644 index 00000000..bb196090 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf @@ -0,0 +1 @@ + GetTempSubDir←{##.GetTempSubDir ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf new file mode 100644 index 00000000..943f5a5b --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf @@ -0,0 +1 @@ + IsDir←{##.IsDir ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf new file mode 100644 index 00000000..cb94db72 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf @@ -0,0 +1 @@ + IsFile←{##.IsFile ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf new file mode 100644 index 00000000..0e76c318 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf @@ -0,0 +1 @@ + IsSymbolicLink←{##.IsSymbolicLink ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf new file mode 100644 index 00000000..96b93ef2 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf @@ -0,0 +1 @@ + ListDirs←{⍺←⊢ ⋄ ⍺ ##.ListDirs ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf new file mode 100644 index 00000000..6e2347f9 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf @@ -0,0 +1 @@ + ListFiles←{⍺←⊢ ⋄ ⍺ ##.ListFiles ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf new file mode 100644 index 00000000..ba35635d --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf @@ -0,0 +1 @@ + MkDir←{1:shy←##.MkDir ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf new file mode 100644 index 00000000..2e857cb3 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf @@ -0,0 +1 @@ + NCREATE←{⍺←⊢ ⋄ ⍺ ##.NCREATE ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf new file mode 100644 index 00000000..867ff6d2 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf @@ -0,0 +1 @@ + NGET←{⍺←⊢ ⋄ ⍺ ##.NGET ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf new file mode 100644 index 00000000..e7f6b60c --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf @@ -0,0 +1,2 @@ + r←NNAMES + r←##.NNAMES diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf new file mode 100644 index 00000000..e266662b --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf @@ -0,0 +1 @@ + NPUT←{⍺←⊢ ⋄ 1:shy←⍺ ##.NPUT ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf new file mode 100644 index 00000000..c89d1f87 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf @@ -0,0 +1 @@ + NormalizePath←{⍺←⊢ ⋄ ⍺ ##.NormalizePath ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf new file mode 100644 index 00000000..0e734c9c --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf @@ -0,0 +1,2 @@ + r←PWD + r←##.PWD diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf new file mode 100644 index 00000000..365c52c3 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf @@ -0,0 +1,2 @@ + {r}←PolishCurrentDir + r←##.PolishCurrentDir diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf new file mode 100644 index 00000000..86403fe1 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf @@ -0,0 +1 @@ + RmDir←{⍺←⊢ ⋄ 1:shy←⍺ ##.RmDir ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf new file mode 100644 index 00000000..03c19b41 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf @@ -0,0 +1 @@ + RmDirByForce←{##.RmDirByForce ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf new file mode 100644 index 00000000..3e480f90 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf @@ -0,0 +1,2 @@ + r←Version + r←##.Version diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf new file mode 100644 index 00000000..5bb0a046 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf @@ -0,0 +1 @@ + YoungerThan←{⍺←⊢ ⋄ ⍺ ##.YoungerThan ⍵} diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf new file mode 100644 index 00000000..4003bce9 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf @@ -0,0 +1,6 @@ + path←{sep}AddTrailingSep path +⍝ Add a trailing separator to `path` in case it does not already have one + sep←{0<⎕NC ⍵:⍎⍵ ⋄ CurrentSep}'sep' + :If 0<≢path + path,←(~(¯1↑path)∊'/\')/sep + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf new file mode 100644 index 00000000..72e63810 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf @@ -0,0 +1,31 @@ + r←Cd path;Lin;r;rc;∆GetCurrentDirectory;∆SetCurrentDirectory;∆chdir +⍝ Reports and/or changes the current directory. +⍝ The method changes the current directory to what is passed as the right argument.\\ +⍝ It returns the former current directory as a result.\\ +⍝ Because an empty right argument has no effect, `Cd ''` effectively reports the +⍝ current directory. See also [`PWD`](#) (Print Work Directory). + path←NormalizePath path + :Select APLTreeUtils2.GetOperatingSystem ⍬ + :Case 'Win' + '∆GetCurrentDirectory'⎕NA'I4 KERNEL32.C32|GetCurrentDirectory* I4 >T[]' + '∆SetCurrentDirectory'⎕NA'I4 KERNEL32.C32|SetCurrentDirectory* <0T' + :If 0=⊃rc←∆GetCurrentDirectory 260 260 + r←GetLastError'GetCurrentDirectory error' '' + :Else + r←NormalizePath⊃↑/rc + :EndIf + :If 0≠≢path←path~'"' + :AndIf ' '=1↑0⍴path + path,←(CurrentSep≠¯1↑path)/CurrentSep + :If ~∆SetCurrentDirectory⊂path + 11 ⎕SIGNAL⍨↑{⍵,'; rc=',⍕⍺}/GetLastError'SetCurrentDirectory error' + :EndIf + :EndIf + :CaseList 'Lin' 'Mac' + path←NormalizePath path + r←⊃⎕SH'pwd' + '∆chdir'⎕NA'I ',OS.GetSharedLib,'| chdir <0T1[]' + {}∆chdir⊂path + :Else + . ⍝ Huuh?! + :EndSelect diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf new file mode 100644 index 00000000..93712990 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf @@ -0,0 +1,26 @@ + {success}←{new}CheckPath path;newFlag +⍝ Returns a 1 if the `path` to be checked is fine, otherwise 0.\\ +⍝ If `path` is nested it will return a vector of the same length as `path` +⍝ * If `path` exists but is not a directory a 0 is returned.\\ +⍝ * If `path` does not exist a 0 is returned.\\ +⍝ * If `path` does not exist but the left argument is "CREATE!" it will be created, +⍝ including any sub directories.\\ +⍝ The left argument is case insensitive. + :If 2=|≡path + :If 0=⎕NC'new' + success←CheckPath¨path + :Else + success←new∘CheckPath¨path + :EndIf + :Else + path←NormalizePath path + :If 1=⎕NEXISTS path + success←IsDir path + :Else + success←0 + newFlag←'CREATE!' 1∊⍨⊂{6::0 ⋄ {(0=1↑0⍴⍵):⍵ ⋄ 1 ⎕C ⍵}⍎⍵}'new' + :If newFlag + success←MkDir path + :EndIf + :EndIf + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf new file mode 100644 index 00000000..4e5ee385 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf @@ -0,0 +1,3 @@ + r←CurrentSep +⍝ Returns what is the "correct" filename separator under the current OS. + r←('Win'≡APLTreeUtils2.GetOperatingSystem ⍬)⊃'/\' diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf new file mode 100644 index 00000000..f786577c --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf @@ -0,0 +1,3 @@ + real←DateToReal timestamp +⍝ Converts a timestamp (`6↑⎕TS`) into a real (YYYYMMDD.hhmmss) + real←60 ⎕DT⊂6↑timestamp diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf new file mode 100644 index 00000000..010622b9 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf @@ -0,0 +1,41 @@ + {success}←DeleteFile filenames;thisFile;flag;counter;i;depth +⍝ Attempts to delete one or more files. Returns 1 in case of success and 0 otherwise +⍝ for each file in `filenames`.\\ +⍝ Retries up to three times for every single files in case of any error 19 or 22.\\ +⍝ This function does not care whether the file exists or not, although naturally +⍝ `success` will be 0 for any non-existing file.\\ +⍝ `filenames` can be one of: +⍝ * Text vector representing a single filename. +⍝ * Vector of text vectors each representing a single file.\\ +⍝ In case `filenames` is empty a 0 is returned.\\ +⍝ Do not uses this function for removing directories: use `RmDir` instead. + :If 0=≢filenames + success←0 + :Else + depth←≡filenames + filenames←,⊆filenames + filenames←NormalizePath filenames + success←(≢filenames)⍴0 + :For i :In ⍳≢filenames + thisFile←i⊃filenames + :If ⎕NEXISTS thisFile + flag←counter←0 + :Repeat + :Trap 19 22 + 1 ⎕NDELETE thisFile + success[i]←flag←1 + flag←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + flag←1 + :EndIf + :EndTrap + :Until flag + :EndIf + :EndFor + :If 1≡depth + success←⊃success + :EndIf + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf new file mode 100644 index 00000000..2e31f063 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf @@ -0,0 +1,149 @@ + r←{parms_}Dir path;buff;list;more;parms;rc;extension;filename;folder;subFolders;pattern;isrecursiveCall +⍝ By default this function returns names. You may request further information by specifying `type`.\\ +⍝ Without a trailing slash and any wildcards `path` is expected to be either a filename or the +⍝ name of a directory. `Dir` returns the requested information for just that file or directory. +⍝ `path` might be empty; in this case it defaults to the current directory.\\ +⍝ `*` and `?` are treated as wildcard characters. That means that `FilesAndDirs` cannot deal with files +⍝ that contain a `*` or a `?` as part of any name, be it directory or filename; under Linux and Mac OS +⍝ these are legal characters for filenames and directory names.\\ +⍝ Only the very last partition of `path` is allowed to carry wildcard characters.\\ +⍝ If the last partition of `path` contains wildcards then `Dir` uses them to filter filenames but not +⍝ directories.\\ +⍝ The result is a vector of the same length as `type`. `type` defaults to 0 which stands for filenames +⍝ and directory names.\\ +⍝ You may specify parameters either as key/value pairs or via a namespace populated with variables. +⍝ Examples: +⍝ ~~~ +⍝ ('recursive' 2) FilesAndDirs.Dir '' ⍝ returns list with directories & files in the current dir. +⍝ ('recursive' 2) FilesAndDirs.Dir '*.md' ⍝ returns list with files with extension "md". +⍝ ~~~ +⍝ +⍝ ~~~ +⍝ parms←⎕ns'' +⍝ parms.recursive←2 +⍝ parms.type←3 4 5 1 0 +⍝ parms FilesAndDirs.Dir '' +⍝ ~~~ +⍝ Note that the names of parameters are case sensitive.\\ +⍝ |Parameter |Default|Meaning| +⍝ |-----------|-------|-------| +⍝ | depth | ⍬ | Ignored when `recursive` is 0.<
    >Use this to restrict the number of times `Dir` goes down the directory tree.<
    >For example, set this to 2 if you are interested just in the given directory and its sub-directories.| +⍝ | follow | 0 | 1=follow symbolic links, meaning that the properties shown are those of the file the link points to rather than the link. | +⍝ | recursive | 0 | 1=scan `path` recursively; may crash with "ACCESS DENIED"; 2=like 1 but ignores directories that cause "ACCESS DENIED"| +⍝ | type | 0 | Use this to select the information to be returned by `Dir`.<
    >0 means names. For more information see help on `⎕NINFO`. | +⍝ Note that `recursiveCall` is used internally in order to detect whether `Dir` has called itself recursively. + r←⍬ + path←NormalizePath path + parms←⎕NS'' + parms.follow←1 + parms.recursive←0 + parms.depth←⍬ + parms.type←0 + parms.recursiveCall←0 + :If 0<⎕NC'parms_' + :If {2::0 ⋄ 1⊣⍵.⎕NL 2}parms_ + {}parms.{{⍎⍺,'←⍵'}/⍵}¨parms_.({⍵(⍎⍵)}¨↓⎕NL 2) + 'Invalid parameter'⎕SIGNAL 11/⍨∨/~(' '~¨⍨↓parms.⎕NL 2)∊'follow' 'recursive' 'type' 'recursiveCall' 'depth' + :Else + parms_←,⊂∘,⍣(2=|≡parms_)⊣parms_ + 'Invalid parameter'⎕SIGNAL 11/⍨0∊(⊃¨parms_)∊(' '~¨⍨↓parms.⎕NL 2),⊂'recursiveCall' + parms.{{⍎⍺,'←⍵'}/⍵}¨parms_ + :EndIf + :EndIf + isrecursiveCall←parms.recursiveCall + :If 0=≢path + :OrIf (,'.')≡,path + path←PWD,CurrentSep + :EndIf + path↓⍨←-(CurrentSep,'*')≡¯2↑path + :If CurrentSep=¯1↑{⍵↓⍨-'*'=¯1↑⍵}path + 'Directory does not exist'⎕SIGNAL 6/⍨0=⎕NEXISTS path + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf ~{(':'=0⊃⍵)∧CurrentSep=1⊃⍵}¯2↑path + :Trap 19 22 + 'Not a directory'⎕SIGNAL 11/⍨1≠1 ⎕NINFO⊣path + :Else + :If 1 5 'Access is denied.'≢⎕DMX.OSError + ({1↓⊃,/(⎕UCS 13),¨⍵}⎕DMX.DM)⎕SIGNAL ⎕EN + :Else + :Return + :EndIf + :EndTrap + :EndIf + :Trap 10 19 22 + r←(0 1,parms.type~0 1)⎕NINFO⍠('Follow'parms.follow)('Wildcard' 1)⊣path,'*' + :Else + r←⍬ ⍝ Apparently we do not have the rights to read the directory, therefore we ignore it + :Return + :EndTrap + :If 0≠≢0⊃r + (0⊃r)←NormalizePath 0⊃r + :EndIf + :If 0T[] I4 I4' + :If 0>mid←⊃mid + :AndIf ¯16777216≤mid + mid←-mid + :EndIf + multiByte←80=⎕DR' ' ⍝ Flag: is Unicode + size←1024×1+multiByte ⍝ Dynamic buffer size + r←↑⊃/FormatMsg(FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_IGNORE_INSERTS)0 mid LangID size size 0 + :If 0=≢r + 'LoadLibrary'⎕NA'I KERNEL32|LoadLibrary* <0T' + ⎕NA'I KERNEL32|FreeLibrary I' + :For this :In 'ADVAPI32' 'NETMSG' 'WININET' 'WSOCK32' + :If 0≠hModule←LoadLibrary(⊂this) + :If this≡'WSOCK32' + ind←10013 10014 10024 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10063 10064 10065 10066 10067 10068 10069 10070 10071 10091 10092 10093 10112 11001 11002 11003 11004 + mid←(10060 10013 10023 10010 10011 10012 10026 10014 10015 10044 10036 10031 10030 10016 10029 10028 10122 10039 10046 10040 10038 10037 10127 10034 10035 10003 10047 10033 10135 10000 10042 10043 10017 10018 10019 10020 10021 10025 10001 10002 10148 10041 10005 10006 10007 10114,mid)[ind⍳mid] + :EndIf + r←↑⊃/FormatMsg(FORMAT_MESSAGE_FROM_HMODULE+FORMAT_MESSAGE_IGNORE_INSERTS)hModule mid LangID size size 0 + {}FreeLibrary hModule + :If ×⊃⍴r + :Leave + :EndIf + :EndIf + :EndFor + :EndIf + r←¯2↓r diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf new file mode 100644 index 00000000..821d0ec2 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf @@ -0,0 +1,8 @@ + newline←GetNewLineCharsFor os +⍝ Returns the proper `newline` character(s) for `os` or, if `os` is empty, for the current OS. + :If 0=≢os + os←APLTreeUtils2.GetOperatingSystem ⍬ + :EndIf + '⍵ is not a supported Operating System'⎕SIGNAL 11/⍨~(⊂os)∊'Win' 'Lin' 'Mac' + newline←('Win' 'Lin' 'Mac'⍳⊂os)⊃(⎕UCS 13 10)(⎕UCS 10)(⎕UCS 10) +⍝Done diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf new file mode 100644 index 00000000..9076773e --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf @@ -0,0 +1,40 @@ + filename←{prefixString}GetTempFilename path;rc;start;no;fno +⍝ Returns the name of an unused temporary filename. If `path` is empty the default temp +⍝ path is taken; that's what `GetTempPath` would return. This means you can overwrite +⍝ this by specifying a path.\\ +⍝ `prefixString`, if defined, is a leading string of the filename +⍝ going to be generated. This is **not** the same as\\ +⍝ `'pref',GetTempFileName ''`\\ +⍝ because specified as left argument it is taken into account +⍝ when the uniqueness of the created filename is tested.\\ +⍝ See also `GetTempFilename2` which is recommended.\\ +⍝ This function does **not** use the Windows built-in function since +⍝ it has proven to be unreliable under W7 (at least). + prefixString←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'prefixString' + path←NormalizePath path + path,←((0≠≢path)∧CurrentSep≠¯1↑path)/CurrentSep + :If 0=≢path + :Trap 0 + path←GetTempPath + :Else + 11 ⎕SIGNAL⍨'Cannot get a temp path; rc=',⍕⎕EN + :EndTrap + :EndIf + :If 0=rc←'Create!'CheckPath path + 11 ⎕SIGNAL⍨'Error during "Create <',path,'>"; rc=',⍕GetLastError + :Else + start←no←⍎ProduceRandomName + :Repeat + filename←path,prefixString,(⎕AN,'_',⍕no),'.tmp' + :Trap 22 + fno←filename ⎕NCREATE 0 + ⎕NUNTIE fno + :Else + fno←0 + :EndTrap + no+←10 + :Until (fno≠0)∨no>start+30×10 ⍝ max 30 tries + 'Unable to create temporay file'⎕SIGNAL 11/⍨fno=0 + :EndIf + filename←NormalizePath filename +⍝Done diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf new file mode 100644 index 00000000..3c22c482 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf @@ -0,0 +1,28 @@ + filename←{extension}GetTempFilename2 prefixString;rc;start;no;fno;path +⍝ Returns the name of a previously unused temporary filename. The file will be created.\\ +⍝ `prefixString`, when empty, defaults to `⎕AN`. The name of +⍝ the file will match `prefixString` followed by an `_` and a randomly generated number.\\ +⍝ `extension`, if defined, defines the extension of the temp file without the dot. +⍝ This defaults to `tmp`.\\ +⍝ This function does **not** use the Windows built-in function since +⍝ it has proven to be unreliable under W7 (at least). + extension←{0<⎕NC ⍵:⍎⍵ ⋄ 'tmp'}'extension' + extension←('.'=1⍴extension)↓extension + :If 0=≢prefixString + prefixString←⎕AN + :EndIf + path←GetTempPath + start←no←⍎ProduceRandomName + :Repeat + filename←path,(prefixString,'_',⍕no),{0=≢⍵:⍵ ⋄ '.',⍵}extension + :Trap 22 + fno←filename ⎕NCREATE 0 + ⎕NUNTIE fno + :Else + fno←0 + :EndTrap + no+←10 + :Until (fno≠0)∨no>start+30×10 ⍝ max 30 tries + 'Unable to create temporay file'⎕SIGNAL 11/⍨fno=0 + filename←NormalizePath filename +⍝Done diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf new file mode 100644 index 00000000..26777806 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf @@ -0,0 +1,18 @@ + path←GetTempPath;∆GetTempPath +⍝ Returns the path to the temp directory on the current system. + :Select APLTreeUtils2.GetOperatingSystem ⍬ + :Case 'Win' + '∆GetTempPath'⎕NA'I4 KERNEL32.C32|GetTempPath* I4 >T[]' + path←⊃↑/∆GetTempPath 1024 1024 + :If 0=≢path + 11 ⎕SIGNAL⍨'Problem getting Windows temp path!; rc=',⍕GetLastError + :Else + path←NormalizePath path + :EndIf + :Case 'Lin' + path←'/tmp/' + :Case 'Mac' + path←'/private/tmp/' + :Else + .⍝ Huuh?! + :EndSelect diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf new file mode 100644 index 00000000..dc19df90 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf @@ -0,0 +1,25 @@ + dirname←GetTempSubDir prefixString;path;no;flag;success;i +⍝ Returns name of previously unused sub directory in the `TEMP` directory with a random name.\\ +⍝ The directory will be created. +⍝ `prefixString`, when empty, defaults to `⎕AN`. The name of the directory will +⍝ match `prefixString` followed by an `_` and a randomly generated number.\\ + 'The right argument must not carry a * or a \'⎕SIGNAL 11/⍨∨/prefixString∊'\*' + :If 0=≢prefixString + prefixString←⎕AN + :EndIf + path←GetTempPath + no←⍎ProduceRandomName + i←0 + success←flag←0 + :Repeat + dirname←path,(({⍵↓⍨-(¯1↑⍵)∊'/\'}prefixString),'_',(⍕no),'_',(⍕i)) + :Trap 22 + 2 ⎕MKDIR dirname~'"' + flag←success←1 + :Else + ⎕DL 0.01+0.01×0=5|5 + :EndTrap + :Until flag∨30' +) diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf new file mode 100644 index 00000000..fbd66f00 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf @@ -0,0 +1,35 @@ + r←IsDir path +⍝ Returns 1 if `path` is a directory and 0 otherwise, even if `path` does exist as a file.\\ +⍝ Notes: +⍝ * If `path` is a directory the current user has no "read" access to then it returns 0! +⍝ * `C:\` is considered a directory, though strictly speaking it is not. + :If 2=≡path + r←IsDir¨path + :Else + path←NormalizePath path + :Trap 11 + :If r←⎕NEXISTS path + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf ~{(':'=0⊃⍵)∧CurrentSep=1⊃⍵}¯2↑path + :Trap 22 + :If 0 ⍝ <1594 + ⍝ Right now, without ('Wildcard' 1), it generates a FILENAME ERROR when the user has not read access + ⍝ See bug report <01594> + ⍝ The `⊃⊃` as well as the `(-'/\'∊⍨¯1↑path)↓` are only needed with ('Wildcard' 1) + :If ('.',CurrentSep)≡2↑path + r←{⊃⊃1=1 ⎕NINFO⍠('Wildcard' 1)⊣(-'/\'∊⍨¯1↑⍵)↓⍵}'expand'NormalizePath path + :Else + r←{⊃⊃1=1 ⎕NINFO⍠('Wildcard' 1)⊣(-'/\'∊⍨¯1↑⍵)↓⍵}path + :EndIf + :Else + r←1=1 ⎕NINFO path + :EndIf + :Else + r←0 + :EndTrap + :EndIf + :EndIf + :Else + r←0 + :EndTrap + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf new file mode 100644 index 00000000..63f3c991 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf @@ -0,0 +1,23 @@ + r←IsFile y +⍝ Returns 1 if `filename` is a regular file and a 0 otherwise, even if `y` does exist as a directory.\\ +⍝ `y` must be either a text vector or a (negative!) tie number of a native file. +⍝ If it is a number but not a tie number then an error is signalled. + :If 2=≡y + r←IsFile¨y + :Else + :If 0=1↑0⍴y + 'Not tied'⎕SIGNAL 18/⍨~y∊⎕NNUMS + r←2=1 ⎕NINFO y + :Else + y←NormalizePath y + :Trap 11 + :If r←⎕NEXISTS y + r←2=1 ⎕NINFO y + :Else + r←0 + :EndIf + :Else + r←0 + :EndTrap + :EndIf + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf new file mode 100644 index 00000000..41b956e0 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf @@ -0,0 +1,14 @@ + r←IsSymbolicLink y +⍝ Returns a 1 if `y` is a symbolic link and a 0 otherwise, even if `y` does exist as a file or directory.\\ +⍝ `y` must be a text vector. + :If 2=≡y + r←IsSymbolicLink¨y + :Else + 'Invalid right argument'⎕SIGNAL 11/⍨' '≠1↑0⍴y + y←NormalizePath y + :Trap 19 22 + r←4=1 ⎕NINFO⍠('Follow' 0)⊣y + :Else + r←0 + :EndTrap + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf new file mode 100644 index 00000000..b0e3556c --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf @@ -0,0 +1,43 @@ + r←{x}ListDirs path;buff;recursiveFlag;part1;part2;recursive;depth +⍝ Lists all directories (but nothing else) in `path`.\\ +⍝ `path` must of course be a directory.\\ +⍝ Specify the string `recursive` (not case sensitive) as left argument to make the +⍝ function work recursively.\\ +⍝ In addition to `recursive` you may also specify an integer defining the depth. For example, +⍝ if you are interested just in the given directories and its sub-directory set this to 2.\\ +⍝ `*` and `?` are treated as wildcard characters. That means that `FilesAndDirs` cannot deal with files +⍝ that contain a `*` or a `?` as part of any name, be it directory or filename; under Linux and Mac OS +⍝ these are legal characters for filenames and directory names.\\ +⍝ Returns a vector of text vectors in case anything was found and `''` otherwise. + x←{0<⎕NC ⍵:⍎⍵ ⋄ ''⍬}'x' + x←⊂∘,⍣((⊃' '=1↑0⍴↑x)∧1=≡x)⊣x + (recursive depth)←2↑x,(≢x)↓0 ⍬ + depth-←1 + path←NormalizePath ,path + (part1 part2)←APLTreeUtils2.SplitPath path + 'Wildcard characters are allowed only in the last part of a path'⎕SIGNAL 11/⍨∨/'?*'∊part1 + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf {(':'=0⊃⍵)∧(1⊃⍵)∊'\/'}¯2↑{⍵↓⍨-(¯1↑⍵)∊'/\'}path + 'Right argument is not a directory'⎕SIGNAL 11/⍨0=IsDir{(a b)←APLTreeUtils2.SplitPath ⍵ ⋄ ~∨/'*?'∊b:⍵ ⋄ a}path + :EndIf + path↓⍨←-CurrentSep=¯1↑path + recursiveFlag←{0=⎕NC ⍵:0 ⋄ w←⍎⍵ ⋄ 0=1↑0⍴w:w ⋄ 'recursive'≡⎕C w}'recursive' + :If recursiveFlag + :AndIf ∨/'*?'∊path + '"path" must not carry wildcard chars in case "Recursive" is specified'⎕SIGNAL 11 + :EndIf + path,←(~∨/'?*'∊path)/CurrentSep + :Trap 10 19 22 + buff←(0 1)⎕NINFO⍠('Wildcard' 1)⊣path,'*' + :Else + r←'' ⍝ Apparently we do not have the rights to read the directory, therefore we ignore it + :Return + :EndTrap + r←(1=1⊃buff)/0⊃buff + :If 0≠≢r←NormalizePath r + :AndIf 1=recursiveFlag + :AndIf 0=+/'*?'∊path + :AndIf (0=≢depth)∨1↑0counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + (1↓⊃,/(⎕UCS 13),¨qdmx.DM)⎕SIGNAL qdmx.EN + :EndIf + :EndTrap + :Until success +⍝Done diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf new file mode 100644 index 00000000..64d8b485 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf @@ -0,0 +1,5 @@ + r←NNAMES +⍝ Same as `⎕NNAMES` but... +⍝ * returns a vector rather than a matrix. +⍝ * normalizes all filenames + r←NormalizePath{⍵↓⍨-+/∧\' '=⌽⍵}¨↓⎕NNAMES diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf new file mode 100644 index 00000000..2eff9ffb --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf @@ -0,0 +1,31 @@ + {r}←data NPUT y;filename;flags;data;counter;success;qdmx +⍝ The purpose of this function is to cover `⎕NPUT` and make sure that the filename is normalized.\\ +⍝ In addition the function tries to overcome FILE ACCESS ERRROs twice. They are pretty common these days with +⍝ tools like DropBox etc.\\ +⍝ The left as well as the right argument must be the same as for a call to the native `⎕NPUT`. + :If (≡y)∊0 1 + filename←NormalizePath y + flags←¯1 + :Else + (filename flags)←y + filename←NormalizePath filename + :EndIf + success←counter←0 + :Repeat + :Trap 19 + :If flags≡¯1 + r←data ⎕NPUT filename + :Else + r←data ⎕NPUT filename flags + :EndIf + success←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + (1↓⊃,/(⎕UCS 13),¨qdmx.DM)⎕SIGNAL qdmx.EN + :EndIf + :EndTrap + :Until success +⍝Done diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf new file mode 100644 index 00000000..4b0017a9 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf @@ -0,0 +1,50 @@ + path←{expandFlag}NormalizePath path;UNCflag;sep;ExpandEnvironmentStrings;isScalar;path_;isWin;hasTrailingSep +⍝ `path` might be either a simple text vector or scalar representing a single filename or a +⍝ vector of text vectors with each item representing a single filename. +⍝ Enforces either `\` or `/` as separator in `path` depending on the current operating system.\\ +⍝ If you need a particular separator no matter what the current OS is then use either +⍝ `EnforceBackslash` or `EnforceSlash`.\\ +⍝ Note that by default a relative path remains relative and any `../` (or `..\`) is not touched. +⍝ You can change this by specifying `'expand'` as the (optional) left argument; then `path` is +⍝ expanded to an absolute path. As a side effect any `../` is transformed appropriately as well.\\ +⍝ On Mac and Linux however only trailing `/..` are transformed. +⍝ Notes: +⍝ * The left argument is not case sensitive. +⍝ * Any pair of `//` or `\\` is reduced to a single one except the first two. +⍝ * Environment variables are expanded. + isScalar←⍬≡⍴path + :If 0≠≢path←,path + :If '%'∊path + :AndIf 'Win'≡APLTreeUtils2.GetOperatingSystem ⍬ + 'ExpandEnvironmentStrings'⎕NA'I4 KERNEL32.C32|ExpandEnvironmentStrings* <0T >0T I4' + path←1⊃ExpandEnvironmentStrings path 2048 2048 + :EndIf + expandFlag←{0<⎕NC ⍵:{0=1↑0⍴⍵:⍵ ⋄ 'expand'≡⎕C ⍵}w←⍎⍵ ⋄ 0}'expandFlag' + isWin←'Win'≡APLTreeUtils2.GetOperatingSystem ⍬ + sep←isWin⌽'\/' + hasTrailingSep←(¯1↑path)∊sep + :If 1<≡path + path←expandFlag NormalizePath¨path + :Else + UNCflag←(⊂2⍴path)∊'\\' '//' + :If expandFlag + path←⊃,/1 ⎕NPARTS path + :If ~isWin + path_←(~path∊sep)⊆path + path←(0⊃sep),(⊃,/((-2×+/∧\(⌽path_)≡¨⊂'..')↓path_),¨0⊃sep) + :If ~hasTrailingSep + path←¯1↓path + :EndIf + :EndIf + :EndIf + ((path=0⊃sep)/path)←1⊃sep + path←(~(2⍴1⊃sep)⍷path)/path + :If UNCflag + path←'\\',1↓path + :EndIf + :If isScalar + :AndIf 1=≢path + path←⊃path + :EndIf + :EndIf + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf new file mode 100644 index 00000000..0fac4224 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf @@ -0,0 +1,5 @@ + r←PWD +⍝ Print Work Directory; same as `Cd''`. + r←⊃1 ⎕NPARTS'' + r↓⍨←-(¯1↑r)∊'/\' + r←NormalizePath r diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf new file mode 100644 index 00000000..7890afef --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf @@ -0,0 +1,10 @@ + {r}←PolishCurrentDir;wsid +⍝ If `⎕WSID` is relative this function does nothing.\\ +⍝ Otherwise the current directory is changed so that it becomes the path part of `⎕WSID`.\\ +⍝ Returns either `''` or the old directory in case of a change. + r←'' + wsid←NormalizePath ⎕WSID + :If ('.',CurrentSep)≢2⍴⎕WSID,' ' + :AndIf CurrentSep∊wsid + r←NormalizePath Cd 0⊃APLTreeUtils2.SplitPath wsid + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf new file mode 100644 index 00000000..f620ee99 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf @@ -0,0 +1,3 @@ + r←ProduceRandomName +⍝ Expensive but successful very soon + r←{(,'ZI2,ZI2,ZI2'⎕FMT 3↑⍵),⍕3↓⍵}3↓⎕TS ⍝ Expensive but successful very soon diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf new file mode 100644 index 00000000..db3b26d5 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf @@ -0,0 +1,37 @@ + r←Public + r←'' + r,←⊂'AddTrailingSep' + r,←⊂'Cd' + r,←⊂'CheckPath' + r,←⊂'CurrentSep' + r,←⊂'DateToReal' + r,←⊂'DeleteFile' + r,←⊂'Dir' + r,←⊂'EnforceBackslash' + r,←⊂'EnforceSlash' + r,←⊂'ExecNfunction' + r,←⊂'Exists' + r,←⊂'ExpandPath' + r,←⊂'GetModifiedDate' + r,←⊂'GetNewLineCharsFor' + r,←⊂'GetTempFilename' + r,←⊂'GetTempFilename2' + r,←⊂'GetTempPath' + r,←⊂'GetTempSubDir' + r,←⊂'IsDir' + r,←⊂'IsFile' + r,←⊂'IsSymbolicLink' + r,←⊂'ListDirs' + r,←⊂'ListFiles' + r,←⊂'MkDir' + r,←⊂'NCREATE' + r,←⊂'NGET' + r,←⊂'NNAMES' + r,←⊂'NPUT' + r,←⊂'NormalizePath' + r,←⊂'PWD' + r,←⊂'PolishCurrentDir' + r,←⊂'RmDir' + r,←⊂'RmDirByForce' + r,←⊂'Version' + r,←⊂'YoungerThan' diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf new file mode 100644 index 00000000..88c3697d --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf @@ -0,0 +1,59 @@ + {(rc en more)}←{mustBeEmpty}RmDir path;list;bool;flags;flag;counter;qdmx +⍝ Tries to remove `path`.\\ +⍝ The method attempts to remove `path` and, by default, **all its contents**.\\ +⍝ If for some reason you want to make sure that `path` is only removed when empty you can +⍝ specify a 1 as left argument. In that case the method will not do anything if the directory +⍝ `path` is not empty.\\ +⍝ However, the method may still be partly successful because it might have deleted files +⍝ in `path` before it actually fails to remove the directory `path` itself.\\ +⍝ The result is a three-element vector: +⍝ 1. `rc`: return code with 0 for "okay" (=deleted) and 1 otherwise. +⍝ 1. `en`: event number (`⎕EN`) in case of an error. +⍝ 1. `more`: empty text vector in case `rc` is 0 and possible additional information otherwise.\\ +⍝ Notes: +⍝ * If `path` does not exist `(0 0 'Directory does not exist')` is returned +⍝ * If `path` exists but is not a directory `(1 6 'Not a directory')` is returned +⍝ * Wildcard characters (`*` and `?`) are not allowed as part of `path` +⍝ If such characters are specified anyway then an error is signalled.\\ +⍝ This is true even under Linux and Mac OS despite the fact that these characters are legal in +⍝ the names of any files and directories. +⍝ * If `path` is a nested vector `RmDir` calls itself recurively. The length of `rc` and `en` and `more` +⍝ match `≢path` in this case. +⍝ * The underlying system function ⎕NDELETE cannot delete read-only files. That means that you cannot +⍝ delete a directory that contains a folder .git, for exmaple. See `RmDirByForce` as an alternative + mustBeEmpty←{0<⎕NC ⍵:⍎⍵ ⋄ 0}'mustBeEmpty' + 'Invalid left argument.'⎕SIGNAL 11/⍨~(⊂mustBeEmpty)∊0 1 + rc←0 ⋄ en←0 ⋄ more←'' + 'Wildcard characters are not allowed'⎕SIGNAL 11/⍨∨/'*?'∊path + :If 2=|≡path + (rc en more)←↓⍉↑mustBeEmpty RmDir¨path + :Else + path←'expand'NormalizePath path + :If ⎕NEXISTS path + :If IsDir path + flags←1+2×~mustBeEmpty + counter←flag←0 + :Repeat + :Trap 19 22 + flags ⎕NDELETE path + flag←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + en←qdmx.EN + more←qdmx.EM + flag←rc←1 + :EndIf + :EndTrap + :Until flag + :Else + more←'Not a directory' + rc←1 + en←6 + :EndIf + :Else + more←'Directory does not exist' + :EndIf + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf new file mode 100644 index 00000000..0c886f2e --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf @@ -0,0 +1,46 @@ + (rc msg)←RmDirByForce path;r;buff;flag;i;os;max +⍝ Removes files and directories by force no matter what, including files that have the read-only flag set.\\ +⍝ Notes: +⍝ * If `path` does not exist `(0 'Directory does not exist')` is returned +⍝ * If `path` exists but is not a directory `(1 'Not a directory')` is returned +⍝ * In case of success `(0 '')` is returned +⍝ * Wildcard characters (`*` and `?`) are not allowed as part of `path` +⍝ If such characters are specified anyway then an error is signalled.\\ +⍝ This is true even on Linux and Mac OS despite the fact that these characters are legal in +⍝ the names of any files and directories. +⍝ * The function checks whether `path` was successfully removed indeed. + path←'expand'NormalizePath path + 'Wildcard characters are not allowed'⎕SIGNAL 11/⍨∨/'*?'∊path + rc←0 ⋄ msg←'' + :If ~⎕NEXISTS path + msg←'Directory does not exist' + :ElseIf ~IsDir path + rc←1 + msg←'Not a directory' + :Else + os←⎕C APLTreeUtils2.GetOperatingSystem ⍬ + max←5+3×os≢'win' + flag←i←0 + :Repeat + :Trap 11 + :Select os + :Case 'win' + buff←∊⎕SH'rmdir /s /q "',(path~'"'),'"' + :Else + buff←∊⎕SH'rm -f -r "',(path~'"'),'"' + :EndSelect + :EndTrap + :If 0≠rc←⎕NEXISTS path + :If max=i←i+1 + :If 0=≢msg←buff + msg←'Removing directory failed' + :EndIf + flag←1 + :Else + ⎕DL 0.2×i + :EndIf + :Else + flag←1 + :EndIf + :Until flag + :EndIf diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf new file mode 100644 index 00000000..6f62df11 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf @@ -0,0 +1,3 @@ + r←Version;json;ns +⍝ See also `History` + r←'FilesAndDirs' '5.6.0' '2023-12-18' diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf new file mode 100644 index 00000000..296aaf92 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf @@ -0,0 +1,5 @@ + bool←file1 YoungerThan file2;real1;real2 +⍝ Returns a Boolean with 1 in case `file1` is "younger" than `file2` + real1←DateToReal GetModifiedDate file1 + real2←DateToReal GetModifiedDate file2 + bool←real1>real2 diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln new file mode 100644 index 00000000..b6210825 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln @@ -0,0 +1,3 @@ +:Namespace quadVars + ##.(⎕IO ⎕ML)←0 1 +:EndNamespace diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/LICENSE b/tatin-packages/aplteam-FilesAndDirs-5.6.0/LICENSE new file mode 100644 index 00000000..ab78d7fa --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) Kai Jaeger + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + +2. The Software is provided "as is", without warranty of any kind, express or + implied, including but not limited to the warranties of merchantability, + fitness for a particular purpose, and non-infringement. In no event shall the + authors or copyright holders be liable for any claim, damages or other + liability, whether in an action of contract, tort, or otherwise, arising from, + out of, or in connection with the Software or the use or other dealings in the + Software. + \ No newline at end of file diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt b/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt new file mode 100644 index 00000000..74878383 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt @@ -0,0 +1,2 @@ +aplteam-OS-3.1.1 +aplteam-APLTreeUtils2-1.3.0 diff --git a/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-package.json b/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-package.json new file mode 100644 index 00000000..e5c07058 --- /dev/null +++ b/tatin-packages/aplteam-FilesAndDirs-5.6.0/apl-package.json @@ -0,0 +1,25 @@ +{ + api: "API", + assets: "", + date: 20231218.092201, + description: "Utilities for doing gymnastics with files and directories", + documentation: "", + files: "", + group: "aplteam", + io: 0, + license: "MIT", + lx: "", + maintainer: "kai@aplteam.com", + minimumAplVersion: "18.0", + ml: 1, + name: "FilesAndDirs", + os_lin: 0, + os_mac: 0, + os_win: 1, + project_url: "https://github.com/aplteam/FilesAndDirs", + source: "APLSource/FilesAndDirs", + tags: "files,directories,copy,move,read,write,get,put", + uri: "https://tatin.dev/", + userCommandScript: "", + version: "5.6.0+153", +} diff --git a/tatin-packages_dev/apl-buildlist.json b/tatin-packages_dev/apl-buildlist.json index 456dd4b0..d279e684 100644 --- a/tatin-packages_dev/apl-buildlist.json +++ b/tatin-packages_dev/apl-buildlist.json @@ -2,7 +2,7 @@ packageID: [ "aplteam-Tester2-3.5.0", "aplteam-MakeHelpers-0.11.0", - "aplteam-FilesAndDirs-5.5.1", + "aplteam-FilesAndDirs-5.6.0", "aplteam-CommTools-1.7.1", "aplteam-CodeCoverage-0.10.3", "aplteam-APLTreeUtils2-1.3.1", diff --git a/tatin-packages_dev/apl-dependencies.txt b/tatin-packages_dev/apl-dependencies.txt index d0444968..1aad2a64 100644 --- a/tatin-packages_dev/apl-dependencies.txt +++ b/tatin-packages_dev/apl-dependencies.txt @@ -1,5 +1,5 @@ aplteam-APLTreeUtils2-1.3.1 -aplteam-FilesAndDirs-5.5.1 +aplteam-FilesAndDirs-5.6.0 aplteam-CodeCoverage-0.10.3 aplteam-Tester2-3.5.0 aplteam-CommTools-1.7.1 diff --git a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc similarity index 93% rename from tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc rename to tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc index e46ea021..107e6b01 100644 --- a/tatin-packages_dev/aplteam-APLTreeUtils2-1.2.0/APLSource/APLTreeUtils2.aplc +++ b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/APLSource/APLTreeUtils2.aplc @@ -3,13 +3,13 @@ ⍝ While `APLTreeUtils` was a namespace scipt designed to be included into pretty much every member of the ⍝ APLTree library, `APLTreeUtils2` is a class with shared methods. You are supposed to call those methods. ⍝ This has some major advantageous over the old approach: -⍝ * It's possible to add new functions to `APLTreeUtils`. With the old approach there was always the possibility +⍝ * It's possible to add new functions to `APLTreeUtils2`. With the old approach there was always the possibility ⍝ of a name clash, so adding new function was practically impossible. ⍝ * The sequence of fixing does not matter (though with lazy fixing that should not be an issue anymore anyway, ⍝ but at the time of writing it still is). ⍝ * Over the years we have seen rare `⎕IO` and `⎕ML` issues with `:Include`. We just avoid the possibility now.\\ ⍝ For a list with the precise differences between `APLTreeUtils` and `APLTreeUtils2` see the project ReadMe on -⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires Dyalog 18.0. +⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires at least Dyalog 18.0. ⍝ Kai Jaeger\\ ⍝ Homepage: @@ -17,10 +17,18 @@ ∇ r←Version :Access Public Shared - r←'APLTreeUtils2' '1.2.0+62' '2023-05-08' + r←'APLTreeUtils2' '1.3.0+62' '2023-11-05' ∇ ∇ History + ⍝ * 1.3.0 from 2023-11-05 + ⍝ * `ToNum` now accepts a left argument which is returned in case the right argument is an empty vector. + ⍝ * New methods: `BitsToInt` and `IntToBits` + ⍝ * 1.2.2 from 2023-10-09 + ⍝ * Minor fix in CreateUUID + ⍝ * License corrected + ⍝ * 1.2.1 from 2023-10-05 + ⍝ * Bug fix in `Create_UUID` ⍝ * 1.2.0 from 2023-05-08 ⍝ * Bug fix: version number corrected ⍝ * 1.1.4 from 2023-04-09 @@ -65,10 +73,16 @@ r←0 2∊⍨10|⎕DR y ∇ - ∇ r←ToNum y - ⍝ Transforms `y` into number(s) + ∇ r←{default}ToNum y + ⍝ Transforms `y` into number(s).\\ + ⍝ In case `y` is empty `default` is returned which defaults to ⍬ (empty numeric vector). :Access Public Shared - r←⊃(//)⎕VFI y + :If 0=≢y + :AndIf 0<⎕NC'default' + r←default + :Else + r←⊃(//)⎕VFI y + :EndIf ∇ ∇ r←IsScripted y @@ -297,11 +311,10 @@ r←3↑⊃'.'⎕WG'APLVersion' ∇ - ∇ r←Create_UUID;⎕RL + ∇ r←Create_UUID ⍝ Produces a UUID :Access Public Shared - ⎕RL←+/⎕TS - r←'-'@(+\9,3⍴5)⊢(⎕D,⎕C ⎕A)[?36⍴16] + r←'-'@(4+5×⍳4)⊢(⎕D,⎕C ⎕A)[4(9+|)@20⊢5@15?36⍴16] ∇ ∇ r←{type}Base64 txt;charset @@ -419,4 +432,18 @@ cats''∘four¨24 part 8 bits ⍵ } + ∇ r←BitsToInt y + ⍝ Unsigned + :Access Public Shared + r←(32⍴2)⊥⌽32↑y + ∇ + + + ∇ r←IntToBits y + ⍝ Unsigned + :Access Public Shared + r←⌽(32⍴2)⊤y + ∇ + + :EndClass diff --git a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/LICENSE b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/LICENSE similarity index 96% rename from tatin-packages/aplteam-APLTreeUtils2-1.2.0/LICENSE rename to tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/LICENSE index bbb529f2..9f8bb329 100644 --- a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/LICENSE +++ b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 APL Team Ltd +Copyright (c) 2018-2023 Kai Jaeger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/apl-package.json b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/apl-package.json similarity index 91% rename from tatin-packages/aplteam-APLTreeUtils2-1.2.0/apl-package.json rename to tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/apl-package.json index a73f5156..4e3dadfb 100644 --- a/tatin-packages/aplteam-APLTreeUtils2-1.2.0/apl-package.json +++ b/tatin-packages_dev/aplteam-APLTreeUtils2-1.3.0/apl-package.json @@ -1,7 +1,7 @@ { api: "APLTreeUtils2", assets: "", - date: 20230508.171103, + date: 20231105.180923, description: "General utilities required by most members of the APLTree library", documentation: "", files: "", @@ -21,5 +21,5 @@ tags: "tools,utilities", uri: "https://tatin.dev/", userCommandScript: "", - version: "1.2.0+68", + version: "1.3.0+74", } diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla new file mode 100644 index 00000000..7aad1867 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ADOC_Doc.apla @@ -0,0 +1,40 @@ +( + '## Overview' + '' + 'This package provides functions that are useful for dealing with files and directories. ' + 'They aim to be platform-independent.\\' + 'Note that error codes and messages may differ between operating systems for the same' + 'type of problem.\\' + '' + '## Characters to avoid in file names and paths' + 'Windows filenames cannot contain any of these characters: `\/:*?"<>|`.' + 'If you want platform-independent code, now or in the future,' + 'avoid using them even in Mac OS or Linux filenames.\\' + '' + '## Separators in file paths' + 'Dyalog tried to ease the pain by converting any `\` character into `/` on Windows.' + 'The idea of sticking always with the `/` as separator because it works anyway is' + 'attractive, but it creates new poblems: when you use third-party software such as a .NET' + 'assembly or an EXE like 7zip.exe on Windows, then you **must** use `\` as a separator.' + 'Even setting the `Directory` property of a `FileBox` object will fail with `/` as the separator.\\' + 'For platform independence it is essential that filenames and directory names are _normalized_.' + 'This means using the correct separator for the current operating system.' + 'Otherwise you could create a directory or file with a backslash in its name, which is disastrous' + 'on Linux or Mac OS.\\' + 'The `FilesAndDirs` functions protect you from this problem by normalizing your file paths.' + 'Use cover functions like `MkDir`, `NNAMES` and `NCREATE` etc. instead of the built-in system ' + 'functions to overcome the problem.\\' + '`⎕NCOPY` and `⎕NMOVE` (introduced in 17.0) are exceptions, but you can use the native function' + 'with the `ExecNfunction` operator.' + 'The `CurrentSep` method returns the correct separator for the current operating system.\\' + 'The `NormalizePath` method normalizes a file path for the current operating system.\\' + 'If you have a particular reason for using `/` under Windows or `\` under Linux' + 'or Mac OS then you can use the `EnforceBackslash` or `EnforceSlash` functions.\\' + '' + '## Misc' + 'This class supports Windows, Mac OS and Linux but neither the Raspberry Pi nor AIX.' + '' + 'Kai Jaeger' + '' + 'Homepage: ' +) diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf new file mode 100644 index 00000000..0d45ffda --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/AddTrailingSep.aplf @@ -0,0 +1 @@ + AddTrailingSep←{⍺←⊢ ⋄ ⍺ ##.AddTrailingSep ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf new file mode 100644 index 00000000..519d9e81 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Cd.aplf @@ -0,0 +1 @@ + Cd←{##.Cd ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf new file mode 100644 index 00000000..4f463d63 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CheckPath.aplf @@ -0,0 +1 @@ + CheckPath←{⍺←⊢ ⋄ 1:shy←⍺ ##.CheckPath ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf new file mode 100644 index 00000000..ee24255d --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/CurrentSep.aplf @@ -0,0 +1,2 @@ + r←CurrentSep + r←##.CurrentSep diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf new file mode 100644 index 00000000..cca3ff56 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DateToReal.aplf @@ -0,0 +1 @@ + DateToReal←{##.DateToReal ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf new file mode 100644 index 00000000..b86efa66 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/DeleteFile.aplf @@ -0,0 +1 @@ + DeleteFile←{1:shy←##.DeleteFile ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf new file mode 100644 index 00000000..41866639 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Dir.aplf @@ -0,0 +1 @@ + Dir←{⍺←⊢ ⋄ ⍺ ##.Dir ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf new file mode 100644 index 00000000..9f84601e --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceBackslash.aplf @@ -0,0 +1 @@ + EnforceBackslash←{##.EnforceBackslash ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf new file mode 100644 index 00000000..2e896e42 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/EnforceSlash.aplf @@ -0,0 +1 @@ + EnforceSlash←{##.EnforceSlash ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo new file mode 100644 index 00000000..84cef47b --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExecNfunction.aplo @@ -0,0 +1 @@ + ExecNfunction←{⍺←⊢ ⋄ 1:shy←⍺(⍺⍺ ##.ExecNfunction)⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf new file mode 100644 index 00000000..3b4c5e31 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Exists.aplf @@ -0,0 +1 @@ + Exists←{##.Exists ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf new file mode 100644 index 00000000..94ed6614 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ExpandPath.aplf @@ -0,0 +1 @@ + ExpandPath←{##.ExpandPath ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf new file mode 100644 index 00000000..bcfc65ba --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetModifiedDate.aplf @@ -0,0 +1 @@ + GetModifiedDate←{##.GetModifiedDate ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf new file mode 100644 index 00000000..6ec9f255 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetNewLineCharsFor.aplf @@ -0,0 +1 @@ + GetNewLineCharsFor←{##.GetNewLineCharsFor ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf new file mode 100644 index 00000000..b997c427 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename.aplf @@ -0,0 +1 @@ + GetTempFilename←{⍺←⊢ ⋄ ⍺ ##.GetTempFilename ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf new file mode 100644 index 00000000..979e2590 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempFilename2.aplf @@ -0,0 +1 @@ + GetTempFilename2←{⍺←⊢ ⋄ ⍺ ##.GetTempFilename2 ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf new file mode 100644 index 00000000..c885179b --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempPath.aplf @@ -0,0 +1,2 @@ + path←GetTempPath + path←##.GetTempPath diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf new file mode 100644 index 00000000..bb196090 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/GetTempSubDir.aplf @@ -0,0 +1 @@ + GetTempSubDir←{##.GetTempSubDir ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf new file mode 100644 index 00000000..943f5a5b --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsDir.aplf @@ -0,0 +1 @@ + IsDir←{##.IsDir ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf new file mode 100644 index 00000000..cb94db72 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsFile.aplf @@ -0,0 +1 @@ + IsFile←{##.IsFile ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf new file mode 100644 index 00000000..0e76c318 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/IsSymbolicLink.aplf @@ -0,0 +1 @@ + IsSymbolicLink←{##.IsSymbolicLink ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf new file mode 100644 index 00000000..96b93ef2 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListDirs.aplf @@ -0,0 +1 @@ + ListDirs←{⍺←⊢ ⋄ ⍺ ##.ListDirs ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf new file mode 100644 index 00000000..6e2347f9 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/ListFiles.aplf @@ -0,0 +1 @@ + ListFiles←{⍺←⊢ ⋄ ⍺ ##.ListFiles ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf new file mode 100644 index 00000000..ba35635d --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/MkDir.aplf @@ -0,0 +1 @@ + MkDir←{1:shy←##.MkDir ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf new file mode 100644 index 00000000..2e857cb3 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NCREATE.aplf @@ -0,0 +1 @@ + NCREATE←{⍺←⊢ ⋄ ⍺ ##.NCREATE ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf new file mode 100644 index 00000000..867ff6d2 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NGET.aplf @@ -0,0 +1 @@ + NGET←{⍺←⊢ ⋄ ⍺ ##.NGET ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf new file mode 100644 index 00000000..e7f6b60c --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NNAMES.aplf @@ -0,0 +1,2 @@ + r←NNAMES + r←##.NNAMES diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf new file mode 100644 index 00000000..e266662b --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NPUT.aplf @@ -0,0 +1 @@ + NPUT←{⍺←⊢ ⋄ 1:shy←⍺ ##.NPUT ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf new file mode 100644 index 00000000..c89d1f87 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/NormalizePath.aplf @@ -0,0 +1 @@ + NormalizePath←{⍺←⊢ ⋄ ⍺ ##.NormalizePath ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf new file mode 100644 index 00000000..0e734c9c --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PWD.aplf @@ -0,0 +1,2 @@ + r←PWD + r←##.PWD diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf new file mode 100644 index 00000000..365c52c3 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/PolishCurrentDir.aplf @@ -0,0 +1,2 @@ + {r}←PolishCurrentDir + r←##.PolishCurrentDir diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf new file mode 100644 index 00000000..86403fe1 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDir.aplf @@ -0,0 +1 @@ + RmDir←{⍺←⊢ ⋄ 1:shy←⍺ ##.RmDir ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf new file mode 100644 index 00000000..03c19b41 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/RmDirByForce.aplf @@ -0,0 +1 @@ + RmDirByForce←{##.RmDirByForce ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf new file mode 100644 index 00000000..3e480f90 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/Version.aplf @@ -0,0 +1,2 @@ + r←Version + r←##.Version diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf new file mode 100644 index 00000000..5bb0a046 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/API/YoungerThan.aplf @@ -0,0 +1 @@ + YoungerThan←{⍺←⊢ ⋄ ⍺ ##.YoungerThan ⍵} diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf new file mode 100644 index 00000000..4003bce9 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/AddTrailingSep.aplf @@ -0,0 +1,6 @@ + path←{sep}AddTrailingSep path +⍝ Add a trailing separator to `path` in case it does not already have one + sep←{0<⎕NC ⍵:⍎⍵ ⋄ CurrentSep}'sep' + :If 0<≢path + path,←(~(¯1↑path)∊'/\')/sep + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf new file mode 100644 index 00000000..72e63810 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Cd.aplf @@ -0,0 +1,31 @@ + r←Cd path;Lin;r;rc;∆GetCurrentDirectory;∆SetCurrentDirectory;∆chdir +⍝ Reports and/or changes the current directory. +⍝ The method changes the current directory to what is passed as the right argument.\\ +⍝ It returns the former current directory as a result.\\ +⍝ Because an empty right argument has no effect, `Cd ''` effectively reports the +⍝ current directory. See also [`PWD`](#) (Print Work Directory). + path←NormalizePath path + :Select APLTreeUtils2.GetOperatingSystem ⍬ + :Case 'Win' + '∆GetCurrentDirectory'⎕NA'I4 KERNEL32.C32|GetCurrentDirectory* I4 >T[]' + '∆SetCurrentDirectory'⎕NA'I4 KERNEL32.C32|SetCurrentDirectory* <0T' + :If 0=⊃rc←∆GetCurrentDirectory 260 260 + r←GetLastError'GetCurrentDirectory error' '' + :Else + r←NormalizePath⊃↑/rc + :EndIf + :If 0≠≢path←path~'"' + :AndIf ' '=1↑0⍴path + path,←(CurrentSep≠¯1↑path)/CurrentSep + :If ~∆SetCurrentDirectory⊂path + 11 ⎕SIGNAL⍨↑{⍵,'; rc=',⍕⍺}/GetLastError'SetCurrentDirectory error' + :EndIf + :EndIf + :CaseList 'Lin' 'Mac' + path←NormalizePath path + r←⊃⎕SH'pwd' + '∆chdir'⎕NA'I ',OS.GetSharedLib,'| chdir <0T1[]' + {}∆chdir⊂path + :Else + . ⍝ Huuh?! + :EndSelect diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf new file mode 100644 index 00000000..93712990 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CheckPath.aplf @@ -0,0 +1,26 @@ + {success}←{new}CheckPath path;newFlag +⍝ Returns a 1 if the `path` to be checked is fine, otherwise 0.\\ +⍝ If `path` is nested it will return a vector of the same length as `path` +⍝ * If `path` exists but is not a directory a 0 is returned.\\ +⍝ * If `path` does not exist a 0 is returned.\\ +⍝ * If `path` does not exist but the left argument is "CREATE!" it will be created, +⍝ including any sub directories.\\ +⍝ The left argument is case insensitive. + :If 2=|≡path + :If 0=⎕NC'new' + success←CheckPath¨path + :Else + success←new∘CheckPath¨path + :EndIf + :Else + path←NormalizePath path + :If 1=⎕NEXISTS path + success←IsDir path + :Else + success←0 + newFlag←'CREATE!' 1∊⍨⊂{6::0 ⋄ {(0=1↑0⍴⍵):⍵ ⋄ 1 ⎕C ⍵}⍎⍵}'new' + :If newFlag + success←MkDir path + :EndIf + :EndIf + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf new file mode 100644 index 00000000..4e5ee385 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/CurrentSep.aplf @@ -0,0 +1,3 @@ + r←CurrentSep +⍝ Returns what is the "correct" filename separator under the current OS. + r←('Win'≡APLTreeUtils2.GetOperatingSystem ⍬)⊃'/\' diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf new file mode 100644 index 00000000..f786577c --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DateToReal.aplf @@ -0,0 +1,3 @@ + real←DateToReal timestamp +⍝ Converts a timestamp (`6↑⎕TS`) into a real (YYYYMMDD.hhmmss) + real←60 ⎕DT⊂6↑timestamp diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf new file mode 100644 index 00000000..010622b9 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/DeleteFile.aplf @@ -0,0 +1,41 @@ + {success}←DeleteFile filenames;thisFile;flag;counter;i;depth +⍝ Attempts to delete one or more files. Returns 1 in case of success and 0 otherwise +⍝ for each file in `filenames`.\\ +⍝ Retries up to three times for every single files in case of any error 19 or 22.\\ +⍝ This function does not care whether the file exists or not, although naturally +⍝ `success` will be 0 for any non-existing file.\\ +⍝ `filenames` can be one of: +⍝ * Text vector representing a single filename. +⍝ * Vector of text vectors each representing a single file.\\ +⍝ In case `filenames` is empty a 0 is returned.\\ +⍝ Do not uses this function for removing directories: use `RmDir` instead. + :If 0=≢filenames + success←0 + :Else + depth←≡filenames + filenames←,⊆filenames + filenames←NormalizePath filenames + success←(≢filenames)⍴0 + :For i :In ⍳≢filenames + thisFile←i⊃filenames + :If ⎕NEXISTS thisFile + flag←counter←0 + :Repeat + :Trap 19 22 + 1 ⎕NDELETE thisFile + success[i]←flag←1 + flag←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + flag←1 + :EndIf + :EndTrap + :Until flag + :EndIf + :EndFor + :If 1≡depth + success←⊃success + :EndIf + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf new file mode 100644 index 00000000..2e31f063 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Dir.aplf @@ -0,0 +1,149 @@ + r←{parms_}Dir path;buff;list;more;parms;rc;extension;filename;folder;subFolders;pattern;isrecursiveCall +⍝ By default this function returns names. You may request further information by specifying `type`.\\ +⍝ Without a trailing slash and any wildcards `path` is expected to be either a filename or the +⍝ name of a directory. `Dir` returns the requested information for just that file or directory. +⍝ `path` might be empty; in this case it defaults to the current directory.\\ +⍝ `*` and `?` are treated as wildcard characters. That means that `FilesAndDirs` cannot deal with files +⍝ that contain a `*` or a `?` as part of any name, be it directory or filename; under Linux and Mac OS +⍝ these are legal characters for filenames and directory names.\\ +⍝ Only the very last partition of `path` is allowed to carry wildcard characters.\\ +⍝ If the last partition of `path` contains wildcards then `Dir` uses them to filter filenames but not +⍝ directories.\\ +⍝ The result is a vector of the same length as `type`. `type` defaults to 0 which stands for filenames +⍝ and directory names.\\ +⍝ You may specify parameters either as key/value pairs or via a namespace populated with variables. +⍝ Examples: +⍝ ~~~ +⍝ ('recursive' 2) FilesAndDirs.Dir '' ⍝ returns list with directories & files in the current dir. +⍝ ('recursive' 2) FilesAndDirs.Dir '*.md' ⍝ returns list with files with extension "md". +⍝ ~~~ +⍝ +⍝ ~~~ +⍝ parms←⎕ns'' +⍝ parms.recursive←2 +⍝ parms.type←3 4 5 1 0 +⍝ parms FilesAndDirs.Dir '' +⍝ ~~~ +⍝ Note that the names of parameters are case sensitive.\\ +⍝ |Parameter |Default|Meaning| +⍝ |-----------|-------|-------| +⍝ | depth | ⍬ | Ignored when `recursive` is 0.<
    >Use this to restrict the number of times `Dir` goes down the directory tree.<
    >For example, set this to 2 if you are interested just in the given directory and its sub-directories.| +⍝ | follow | 0 | 1=follow symbolic links, meaning that the properties shown are those of the file the link points to rather than the link. | +⍝ | recursive | 0 | 1=scan `path` recursively; may crash with "ACCESS DENIED"; 2=like 1 but ignores directories that cause "ACCESS DENIED"| +⍝ | type | 0 | Use this to select the information to be returned by `Dir`.<
    >0 means names. For more information see help on `⎕NINFO`. | +⍝ Note that `recursiveCall` is used internally in order to detect whether `Dir` has called itself recursively. + r←⍬ + path←NormalizePath path + parms←⎕NS'' + parms.follow←1 + parms.recursive←0 + parms.depth←⍬ + parms.type←0 + parms.recursiveCall←0 + :If 0<⎕NC'parms_' + :If {2::0 ⋄ 1⊣⍵.⎕NL 2}parms_ + {}parms.{{⍎⍺,'←⍵'}/⍵}¨parms_.({⍵(⍎⍵)}¨↓⎕NL 2) + 'Invalid parameter'⎕SIGNAL 11/⍨∨/~(' '~¨⍨↓parms.⎕NL 2)∊'follow' 'recursive' 'type' 'recursiveCall' 'depth' + :Else + parms_←,⊂∘,⍣(2=|≡parms_)⊣parms_ + 'Invalid parameter'⎕SIGNAL 11/⍨0∊(⊃¨parms_)∊(' '~¨⍨↓parms.⎕NL 2),⊂'recursiveCall' + parms.{{⍎⍺,'←⍵'}/⍵}¨parms_ + :EndIf + :EndIf + isrecursiveCall←parms.recursiveCall + :If 0=≢path + :OrIf (,'.')≡,path + path←PWD,CurrentSep + :EndIf + path↓⍨←-(CurrentSep,'*')≡¯2↑path + :If CurrentSep=¯1↑{⍵↓⍨-'*'=¯1↑⍵}path + 'Directory does not exist'⎕SIGNAL 6/⍨0=⎕NEXISTS path + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf ~{(':'=0⊃⍵)∧CurrentSep=1⊃⍵}¯2↑path + :Trap 19 22 + 'Not a directory'⎕SIGNAL 11/⍨1≠1 ⎕NINFO⊣path + :Else + :If 1 5 'Access is denied.'≢⎕DMX.OSError + ({1↓⊃,/(⎕UCS 13),¨⍵}⎕DMX.DM)⎕SIGNAL ⎕EN + :Else + :Return + :EndIf + :EndTrap + :EndIf + :Trap 10 19 22 + r←(0 1,parms.type~0 1)⎕NINFO⍠('Follow'parms.follow)('Wildcard' 1)⊣path,'*' + :Else + r←⍬ ⍝ Apparently we do not have the rights to read the directory, therefore we ignore it + :Return + :EndTrap + :If 0≠≢0⊃r + (0⊃r)←NormalizePath 0⊃r + :EndIf + :If 0T[] I4 I4' + :If 0>mid←⊃mid + :AndIf ¯16777216≤mid + mid←-mid + :EndIf + multiByte←80=⎕DR' ' ⍝ Flag: is Unicode + size←1024×1+multiByte ⍝ Dynamic buffer size + r←↑⊃/FormatMsg(FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_IGNORE_INSERTS)0 mid LangID size size 0 + :If 0=≢r + 'LoadLibrary'⎕NA'I KERNEL32|LoadLibrary* <0T' + ⎕NA'I KERNEL32|FreeLibrary I' + :For this :In 'ADVAPI32' 'NETMSG' 'WININET' 'WSOCK32' + :If 0≠hModule←LoadLibrary(⊂this) + :If this≡'WSOCK32' + ind←10013 10014 10024 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10063 10064 10065 10066 10067 10068 10069 10070 10071 10091 10092 10093 10112 11001 11002 11003 11004 + mid←(10060 10013 10023 10010 10011 10012 10026 10014 10015 10044 10036 10031 10030 10016 10029 10028 10122 10039 10046 10040 10038 10037 10127 10034 10035 10003 10047 10033 10135 10000 10042 10043 10017 10018 10019 10020 10021 10025 10001 10002 10148 10041 10005 10006 10007 10114,mid)[ind⍳mid] + :EndIf + r←↑⊃/FormatMsg(FORMAT_MESSAGE_FROM_HMODULE+FORMAT_MESSAGE_IGNORE_INSERTS)hModule mid LangID size size 0 + {}FreeLibrary hModule + :If ×⊃⍴r + :Leave + :EndIf + :EndIf + :EndFor + :EndIf + r←¯2↓r diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf new file mode 100644 index 00000000..821d0ec2 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetNewLineCharsFor.aplf @@ -0,0 +1,8 @@ + newline←GetNewLineCharsFor os +⍝ Returns the proper `newline` character(s) for `os` or, if `os` is empty, for the current OS. + :If 0=≢os + os←APLTreeUtils2.GetOperatingSystem ⍬ + :EndIf + '⍵ is not a supported Operating System'⎕SIGNAL 11/⍨~(⊂os)∊'Win' 'Lin' 'Mac' + newline←('Win' 'Lin' 'Mac'⍳⊂os)⊃(⎕UCS 13 10)(⎕UCS 10)(⎕UCS 10) +⍝Done diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf new file mode 100644 index 00000000..9076773e --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename.aplf @@ -0,0 +1,40 @@ + filename←{prefixString}GetTempFilename path;rc;start;no;fno +⍝ Returns the name of an unused temporary filename. If `path` is empty the default temp +⍝ path is taken; that's what `GetTempPath` would return. This means you can overwrite +⍝ this by specifying a path.\\ +⍝ `prefixString`, if defined, is a leading string of the filename +⍝ going to be generated. This is **not** the same as\\ +⍝ `'pref',GetTempFileName ''`\\ +⍝ because specified as left argument it is taken into account +⍝ when the uniqueness of the created filename is tested.\\ +⍝ See also `GetTempFilename2` which is recommended.\\ +⍝ This function does **not** use the Windows built-in function since +⍝ it has proven to be unreliable under W7 (at least). + prefixString←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'prefixString' + path←NormalizePath path + path,←((0≠≢path)∧CurrentSep≠¯1↑path)/CurrentSep + :If 0=≢path + :Trap 0 + path←GetTempPath + :Else + 11 ⎕SIGNAL⍨'Cannot get a temp path; rc=',⍕⎕EN + :EndTrap + :EndIf + :If 0=rc←'Create!'CheckPath path + 11 ⎕SIGNAL⍨'Error during "Create <',path,'>"; rc=',⍕GetLastError + :Else + start←no←⍎ProduceRandomName + :Repeat + filename←path,prefixString,(⎕AN,'_',⍕no),'.tmp' + :Trap 22 + fno←filename ⎕NCREATE 0 + ⎕NUNTIE fno + :Else + fno←0 + :EndTrap + no+←10 + :Until (fno≠0)∨no>start+30×10 ⍝ max 30 tries + 'Unable to create temporay file'⎕SIGNAL 11/⍨fno=0 + :EndIf + filename←NormalizePath filename +⍝Done diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf new file mode 100644 index 00000000..3c22c482 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempFilename2.aplf @@ -0,0 +1,28 @@ + filename←{extension}GetTempFilename2 prefixString;rc;start;no;fno;path +⍝ Returns the name of a previously unused temporary filename. The file will be created.\\ +⍝ `prefixString`, when empty, defaults to `⎕AN`. The name of +⍝ the file will match `prefixString` followed by an `_` and a randomly generated number.\\ +⍝ `extension`, if defined, defines the extension of the temp file without the dot. +⍝ This defaults to `tmp`.\\ +⍝ This function does **not** use the Windows built-in function since +⍝ it has proven to be unreliable under W7 (at least). + extension←{0<⎕NC ⍵:⍎⍵ ⋄ 'tmp'}'extension' + extension←('.'=1⍴extension)↓extension + :If 0=≢prefixString + prefixString←⎕AN + :EndIf + path←GetTempPath + start←no←⍎ProduceRandomName + :Repeat + filename←path,(prefixString,'_',⍕no),{0=≢⍵:⍵ ⋄ '.',⍵}extension + :Trap 22 + fno←filename ⎕NCREATE 0 + ⎕NUNTIE fno + :Else + fno←0 + :EndTrap + no+←10 + :Until (fno≠0)∨no>start+30×10 ⍝ max 30 tries + 'Unable to create temporay file'⎕SIGNAL 11/⍨fno=0 + filename←NormalizePath filename +⍝Done diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf new file mode 100644 index 00000000..26777806 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempPath.aplf @@ -0,0 +1,18 @@ + path←GetTempPath;∆GetTempPath +⍝ Returns the path to the temp directory on the current system. + :Select APLTreeUtils2.GetOperatingSystem ⍬ + :Case 'Win' + '∆GetTempPath'⎕NA'I4 KERNEL32.C32|GetTempPath* I4 >T[]' + path←⊃↑/∆GetTempPath 1024 1024 + :If 0=≢path + 11 ⎕SIGNAL⍨'Problem getting Windows temp path!; rc=',⍕GetLastError + :Else + path←NormalizePath path + :EndIf + :Case 'Lin' + path←'/tmp/' + :Case 'Mac' + path←'/private/tmp/' + :Else + .⍝ Huuh?! + :EndSelect diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf new file mode 100644 index 00000000..dc19df90 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/GetTempSubDir.aplf @@ -0,0 +1,25 @@ + dirname←GetTempSubDir prefixString;path;no;flag;success;i +⍝ Returns name of previously unused sub directory in the `TEMP` directory with a random name.\\ +⍝ The directory will be created. +⍝ `prefixString`, when empty, defaults to `⎕AN`. The name of the directory will +⍝ match `prefixString` followed by an `_` and a randomly generated number.\\ + 'The right argument must not carry a * or a \'⎕SIGNAL 11/⍨∨/prefixString∊'\*' + :If 0=≢prefixString + prefixString←⎕AN + :EndIf + path←GetTempPath + no←⍎ProduceRandomName + i←0 + success←flag←0 + :Repeat + dirname←path,(({⍵↓⍨-(¯1↑⍵)∊'/\'}prefixString),'_',(⍕no),'_',(⍕i)) + :Trap 22 + 2 ⎕MKDIR dirname~'"' + flag←success←1 + :Else + ⎕DL 0.01+0.01×0=5|5 + :EndTrap + :Until flag∨30' +) diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf new file mode 100644 index 00000000..fbd66f00 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsDir.aplf @@ -0,0 +1,35 @@ + r←IsDir path +⍝ Returns 1 if `path` is a directory and 0 otherwise, even if `path` does exist as a file.\\ +⍝ Notes: +⍝ * If `path` is a directory the current user has no "read" access to then it returns 0! +⍝ * `C:\` is considered a directory, though strictly speaking it is not. + :If 2=≡path + r←IsDir¨path + :Else + path←NormalizePath path + :Trap 11 + :If r←⎕NEXISTS path + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf ~{(':'=0⊃⍵)∧CurrentSep=1⊃⍵}¯2↑path + :Trap 22 + :If 0 ⍝ <1594 + ⍝ Right now, without ('Wildcard' 1), it generates a FILENAME ERROR when the user has not read access + ⍝ See bug report <01594> + ⍝ The `⊃⊃` as well as the `(-'/\'∊⍨¯1↑path)↓` are only needed with ('Wildcard' 1) + :If ('.',CurrentSep)≡2↑path + r←{⊃⊃1=1 ⎕NINFO⍠('Wildcard' 1)⊣(-'/\'∊⍨¯1↑⍵)↓⍵}'expand'NormalizePath path + :Else + r←{⊃⊃1=1 ⎕NINFO⍠('Wildcard' 1)⊣(-'/\'∊⍨¯1↑⍵)↓⍵}path + :EndIf + :Else + r←1=1 ⎕NINFO path + :EndIf + :Else + r←0 + :EndTrap + :EndIf + :EndIf + :Else + r←0 + :EndTrap + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf new file mode 100644 index 00000000..63f3c991 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsFile.aplf @@ -0,0 +1,23 @@ + r←IsFile y +⍝ Returns 1 if `filename` is a regular file and a 0 otherwise, even if `y` does exist as a directory.\\ +⍝ `y` must be either a text vector or a (negative!) tie number of a native file. +⍝ If it is a number but not a tie number then an error is signalled. + :If 2=≡y + r←IsFile¨y + :Else + :If 0=1↑0⍴y + 'Not tied'⎕SIGNAL 18/⍨~y∊⎕NNUMS + r←2=1 ⎕NINFO y + :Else + y←NormalizePath y + :Trap 11 + :If r←⎕NEXISTS y + r←2=1 ⎕NINFO y + :Else + r←0 + :EndIf + :Else + r←0 + :EndTrap + :EndIf + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf new file mode 100644 index 00000000..41b956e0 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/IsSymbolicLink.aplf @@ -0,0 +1,14 @@ + r←IsSymbolicLink y +⍝ Returns a 1 if `y` is a symbolic link and a 0 otherwise, even if `y` does exist as a file or directory.\\ +⍝ `y` must be a text vector. + :If 2=≡y + r←IsSymbolicLink¨y + :Else + 'Invalid right argument'⎕SIGNAL 11/⍨' '≠1↑0⍴y + y←NormalizePath y + :Trap 19 22 + r←4=1 ⎕NINFO⍠('Follow' 0)⊣y + :Else + r←0 + :EndTrap + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf new file mode 100644 index 00000000..b0e3556c --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ListDirs.aplf @@ -0,0 +1,43 @@ + r←{x}ListDirs path;buff;recursiveFlag;part1;part2;recursive;depth +⍝ Lists all directories (but nothing else) in `path`.\\ +⍝ `path` must of course be a directory.\\ +⍝ Specify the string `recursive` (not case sensitive) as left argument to make the +⍝ function work recursively.\\ +⍝ In addition to `recursive` you may also specify an integer defining the depth. For example, +⍝ if you are interested just in the given directories and its sub-directory set this to 2.\\ +⍝ `*` and `?` are treated as wildcard characters. That means that `FilesAndDirs` cannot deal with files +⍝ that contain a `*` or a `?` as part of any name, be it directory or filename; under Linux and Mac OS +⍝ these are legal characters for filenames and directory names.\\ +⍝ Returns a vector of text vectors in case anything was found and `''` otherwise. + x←{0<⎕NC ⍵:⍎⍵ ⋄ ''⍬}'x' + x←⊂∘,⍣((⊃' '=1↑0⍴↑x)∧1=≡x)⊣x + (recursive depth)←2↑x,(≢x)↓0 ⍬ + depth-←1 + path←NormalizePath ,path + (part1 part2)←APLTreeUtils2.SplitPath path + 'Wildcard characters are allowed only in the last part of a path'⎕SIGNAL 11/⍨∨/'?*'∊part1 + :If 'Win'≢APLTreeUtils2.GetOperatingSystem ⍬ + :OrIf {(':'=0⊃⍵)∧(1⊃⍵)∊'\/'}¯2↑{⍵↓⍨-(¯1↑⍵)∊'/\'}path + 'Right argument is not a directory'⎕SIGNAL 11/⍨0=IsDir{(a b)←APLTreeUtils2.SplitPath ⍵ ⋄ ~∨/'*?'∊b:⍵ ⋄ a}path + :EndIf + path↓⍨←-CurrentSep=¯1↑path + recursiveFlag←{0=⎕NC ⍵:0 ⋄ w←⍎⍵ ⋄ 0=1↑0⍴w:w ⋄ 'recursive'≡⎕C w}'recursive' + :If recursiveFlag + :AndIf ∨/'*?'∊path + '"path" must not carry wildcard chars in case "Recursive" is specified'⎕SIGNAL 11 + :EndIf + path,←(~∨/'?*'∊path)/CurrentSep + :Trap 10 19 22 + buff←(0 1)⎕NINFO⍠('Wildcard' 1)⊣path,'*' + :Else + r←'' ⍝ Apparently we do not have the rights to read the directory, therefore we ignore it + :Return + :EndTrap + r←(1=1⊃buff)/0⊃buff + :If 0≠≢r←NormalizePath r + :AndIf 1=recursiveFlag + :AndIf 0=+/'*?'∊path + :AndIf (0=≢depth)∨1↑0counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + (1↓⊃,/(⎕UCS 13),¨qdmx.DM)⎕SIGNAL qdmx.EN + :EndIf + :EndTrap + :Until success +⍝Done diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf new file mode 100644 index 00000000..64d8b485 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NNAMES.aplf @@ -0,0 +1,5 @@ + r←NNAMES +⍝ Same as `⎕NNAMES` but... +⍝ * returns a vector rather than a matrix. +⍝ * normalizes all filenames + r←NormalizePath{⍵↓⍨-+/∧\' '=⌽⍵}¨↓⎕NNAMES diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf new file mode 100644 index 00000000..2eff9ffb --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NPUT.aplf @@ -0,0 +1,31 @@ + {r}←data NPUT y;filename;flags;data;counter;success;qdmx +⍝ The purpose of this function is to cover `⎕NPUT` and make sure that the filename is normalized.\\ +⍝ In addition the function tries to overcome FILE ACCESS ERRROs twice. They are pretty common these days with +⍝ tools like DropBox etc.\\ +⍝ The left as well as the right argument must be the same as for a call to the native `⎕NPUT`. + :If (≡y)∊0 1 + filename←NormalizePath y + flags←¯1 + :Else + (filename flags)←y + filename←NormalizePath filename + :EndIf + success←counter←0 + :Repeat + :Trap 19 + :If flags≡¯1 + r←data ⎕NPUT filename + :Else + r←data ⎕NPUT filename flags + :EndIf + success←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + (1↓⊃,/(⎕UCS 13),¨qdmx.DM)⎕SIGNAL qdmx.EN + :EndIf + :EndTrap + :Until success +⍝Done diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf new file mode 100644 index 00000000..4b0017a9 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/NormalizePath.aplf @@ -0,0 +1,50 @@ + path←{expandFlag}NormalizePath path;UNCflag;sep;ExpandEnvironmentStrings;isScalar;path_;isWin;hasTrailingSep +⍝ `path` might be either a simple text vector or scalar representing a single filename or a +⍝ vector of text vectors with each item representing a single filename. +⍝ Enforces either `\` or `/` as separator in `path` depending on the current operating system.\\ +⍝ If you need a particular separator no matter what the current OS is then use either +⍝ `EnforceBackslash` or `EnforceSlash`.\\ +⍝ Note that by default a relative path remains relative and any `../` (or `..\`) is not touched. +⍝ You can change this by specifying `'expand'` as the (optional) left argument; then `path` is +⍝ expanded to an absolute path. As a side effect any `../` is transformed appropriately as well.\\ +⍝ On Mac and Linux however only trailing `/..` are transformed. +⍝ Notes: +⍝ * The left argument is not case sensitive. +⍝ * Any pair of `//` or `\\` is reduced to a single one except the first two. +⍝ * Environment variables are expanded. + isScalar←⍬≡⍴path + :If 0≠≢path←,path + :If '%'∊path + :AndIf 'Win'≡APLTreeUtils2.GetOperatingSystem ⍬ + 'ExpandEnvironmentStrings'⎕NA'I4 KERNEL32.C32|ExpandEnvironmentStrings* <0T >0T I4' + path←1⊃ExpandEnvironmentStrings path 2048 2048 + :EndIf + expandFlag←{0<⎕NC ⍵:{0=1↑0⍴⍵:⍵ ⋄ 'expand'≡⎕C ⍵}w←⍎⍵ ⋄ 0}'expandFlag' + isWin←'Win'≡APLTreeUtils2.GetOperatingSystem ⍬ + sep←isWin⌽'\/' + hasTrailingSep←(¯1↑path)∊sep + :If 1<≡path + path←expandFlag NormalizePath¨path + :Else + UNCflag←(⊂2⍴path)∊'\\' '//' + :If expandFlag + path←⊃,/1 ⎕NPARTS path + :If ~isWin + path_←(~path∊sep)⊆path + path←(0⊃sep),(⊃,/((-2×+/∧\(⌽path_)≡¨⊂'..')↓path_),¨0⊃sep) + :If ~hasTrailingSep + path←¯1↓path + :EndIf + :EndIf + :EndIf + ((path=0⊃sep)/path)←1⊃sep + path←(~(2⍴1⊃sep)⍷path)/path + :If UNCflag + path←'\\',1↓path + :EndIf + :If isScalar + :AndIf 1=≢path + path←⊃path + :EndIf + :EndIf + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf new file mode 100644 index 00000000..0fac4224 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PWD.aplf @@ -0,0 +1,5 @@ + r←PWD +⍝ Print Work Directory; same as `Cd''`. + r←⊃1 ⎕NPARTS'' + r↓⍨←-(¯1↑r)∊'/\' + r←NormalizePath r diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf new file mode 100644 index 00000000..7890afef --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/PolishCurrentDir.aplf @@ -0,0 +1,10 @@ + {r}←PolishCurrentDir;wsid +⍝ If `⎕WSID` is relative this function does nothing.\\ +⍝ Otherwise the current directory is changed so that it becomes the path part of `⎕WSID`.\\ +⍝ Returns either `''` or the old directory in case of a change. + r←'' + wsid←NormalizePath ⎕WSID + :If ('.',CurrentSep)≢2⍴⎕WSID,' ' + :AndIf CurrentSep∊wsid + r←NormalizePath Cd 0⊃APLTreeUtils2.SplitPath wsid + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf new file mode 100644 index 00000000..f620ee99 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/ProduceRandomName.aplf @@ -0,0 +1,3 @@ + r←ProduceRandomName +⍝ Expensive but successful very soon + r←{(,'ZI2,ZI2,ZI2'⎕FMT 3↑⍵),⍕3↓⍵}3↓⎕TS ⍝ Expensive but successful very soon diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf new file mode 100644 index 00000000..db3b26d5 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Public.aplf @@ -0,0 +1,37 @@ + r←Public + r←'' + r,←⊂'AddTrailingSep' + r,←⊂'Cd' + r,←⊂'CheckPath' + r,←⊂'CurrentSep' + r,←⊂'DateToReal' + r,←⊂'DeleteFile' + r,←⊂'Dir' + r,←⊂'EnforceBackslash' + r,←⊂'EnforceSlash' + r,←⊂'ExecNfunction' + r,←⊂'Exists' + r,←⊂'ExpandPath' + r,←⊂'GetModifiedDate' + r,←⊂'GetNewLineCharsFor' + r,←⊂'GetTempFilename' + r,←⊂'GetTempFilename2' + r,←⊂'GetTempPath' + r,←⊂'GetTempSubDir' + r,←⊂'IsDir' + r,←⊂'IsFile' + r,←⊂'IsSymbolicLink' + r,←⊂'ListDirs' + r,←⊂'ListFiles' + r,←⊂'MkDir' + r,←⊂'NCREATE' + r,←⊂'NGET' + r,←⊂'NNAMES' + r,←⊂'NPUT' + r,←⊂'NormalizePath' + r,←⊂'PWD' + r,←⊂'PolishCurrentDir' + r,←⊂'RmDir' + r,←⊂'RmDirByForce' + r,←⊂'Version' + r,←⊂'YoungerThan' diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf new file mode 100644 index 00000000..88c3697d --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDir.aplf @@ -0,0 +1,59 @@ + {(rc en more)}←{mustBeEmpty}RmDir path;list;bool;flags;flag;counter;qdmx +⍝ Tries to remove `path`.\\ +⍝ The method attempts to remove `path` and, by default, **all its contents**.\\ +⍝ If for some reason you want to make sure that `path` is only removed when empty you can +⍝ specify a 1 as left argument. In that case the method will not do anything if the directory +⍝ `path` is not empty.\\ +⍝ However, the method may still be partly successful because it might have deleted files +⍝ in `path` before it actually fails to remove the directory `path` itself.\\ +⍝ The result is a three-element vector: +⍝ 1. `rc`: return code with 0 for "okay" (=deleted) and 1 otherwise. +⍝ 1. `en`: event number (`⎕EN`) in case of an error. +⍝ 1. `more`: empty text vector in case `rc` is 0 and possible additional information otherwise.\\ +⍝ Notes: +⍝ * If `path` does not exist `(0 0 'Directory does not exist')` is returned +⍝ * If `path` exists but is not a directory `(1 6 'Not a directory')` is returned +⍝ * Wildcard characters (`*` and `?`) are not allowed as part of `path` +⍝ If such characters are specified anyway then an error is signalled.\\ +⍝ This is true even under Linux and Mac OS despite the fact that these characters are legal in +⍝ the names of any files and directories. +⍝ * If `path` is a nested vector `RmDir` calls itself recurively. The length of `rc` and `en` and `more` +⍝ match `≢path` in this case. +⍝ * The underlying system function ⎕NDELETE cannot delete read-only files. That means that you cannot +⍝ delete a directory that contains a folder .git, for exmaple. See `RmDirByForce` as an alternative + mustBeEmpty←{0<⎕NC ⍵:⍎⍵ ⋄ 0}'mustBeEmpty' + 'Invalid left argument.'⎕SIGNAL 11/⍨~(⊂mustBeEmpty)∊0 1 + rc←0 ⋄ en←0 ⋄ more←'' + 'Wildcard characters are not allowed'⎕SIGNAL 11/⍨∨/'*?'∊path + :If 2=|≡path + (rc en more)←↓⍉↑mustBeEmpty RmDir¨path + :Else + path←'expand'NormalizePath path + :If ⎕NEXISTS path + :If IsDir path + flags←1+2×~mustBeEmpty + counter←flag←0 + :Repeat + :Trap 19 22 + flags ⎕NDELETE path + flag←1 + :Else + :If 4>counter←counter+1 + ⎕DL 0.1×counter + :Else + qdmx←⎕DMX + en←qdmx.EN + more←qdmx.EM + flag←rc←1 + :EndIf + :EndTrap + :Until flag + :Else + more←'Not a directory' + rc←1 + en←6 + :EndIf + :Else + more←'Directory does not exist' + :EndIf + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf new file mode 100644 index 00000000..0c886f2e --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/RmDirByForce.aplf @@ -0,0 +1,46 @@ + (rc msg)←RmDirByForce path;r;buff;flag;i;os;max +⍝ Removes files and directories by force no matter what, including files that have the read-only flag set.\\ +⍝ Notes: +⍝ * If `path` does not exist `(0 'Directory does not exist')` is returned +⍝ * If `path` exists but is not a directory `(1 'Not a directory')` is returned +⍝ * In case of success `(0 '')` is returned +⍝ * Wildcard characters (`*` and `?`) are not allowed as part of `path` +⍝ If such characters are specified anyway then an error is signalled.\\ +⍝ This is true even on Linux and Mac OS despite the fact that these characters are legal in +⍝ the names of any files and directories. +⍝ * The function checks whether `path` was successfully removed indeed. + path←'expand'NormalizePath path + 'Wildcard characters are not allowed'⎕SIGNAL 11/⍨∨/'*?'∊path + rc←0 ⋄ msg←'' + :If ~⎕NEXISTS path + msg←'Directory does not exist' + :ElseIf ~IsDir path + rc←1 + msg←'Not a directory' + :Else + os←⎕C APLTreeUtils2.GetOperatingSystem ⍬ + max←5+3×os≢'win' + flag←i←0 + :Repeat + :Trap 11 + :Select os + :Case 'win' + buff←∊⎕SH'rmdir /s /q "',(path~'"'),'"' + :Else + buff←∊⎕SH'rm -f -r "',(path~'"'),'"' + :EndSelect + :EndTrap + :If 0≠rc←⎕NEXISTS path + :If max=i←i+1 + :If 0=≢msg←buff + msg←'Removing directory failed' + :EndIf + flag←1 + :Else + ⎕DL 0.2×i + :EndIf + :Else + flag←1 + :EndIf + :Until flag + :EndIf diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf new file mode 100644 index 00000000..6f62df11 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/Version.aplf @@ -0,0 +1,3 @@ + r←Version;json;ns +⍝ See also `History` + r←'FilesAndDirs' '5.6.0' '2023-12-18' diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf new file mode 100644 index 00000000..296aaf92 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/YoungerThan.aplf @@ -0,0 +1,5 @@ + bool←file1 YoungerThan file2;real1;real2 +⍝ Returns a Boolean with 1 in case `file1` is "younger" than `file2` + real1←DateToReal GetModifiedDate file1 + real2←DateToReal GetModifiedDate file2 + bool←real1>real2 diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln new file mode 100644 index 00000000..b6210825 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/APLSource/FilesAndDirs/quadVars.apln @@ -0,0 +1,3 @@ +:Namespace quadVars + ##.(⎕IO ⎕ML)←0 1 +:EndNamespace diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/LICENSE b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/LICENSE new file mode 100644 index 00000000..ab78d7fa --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) Kai Jaeger + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +1. The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + +2. The Software is provided "as is", without warranty of any kind, express or + implied, including but not limited to the warranties of merchantability, + fitness for a particular purpose, and non-infringement. In no event shall the + authors or copyright holders be liable for any claim, damages or other + liability, whether in an action of contract, tort, or otherwise, arising from, + out of, or in connection with the Software or the use or other dealings in the + Software. + \ No newline at end of file diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt new file mode 100644 index 00000000..74878383 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-dependencies.txt @@ -0,0 +1,2 @@ +aplteam-OS-3.1.1 +aplteam-APLTreeUtils2-1.3.0 diff --git a/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-package.json b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-package.json new file mode 100644 index 00000000..e5c07058 --- /dev/null +++ b/tatin-packages_dev/aplteam-FilesAndDirs-5.6.0/apl-package.json @@ -0,0 +1,25 @@ +{ + api: "API", + assets: "", + date: 20231218.092201, + description: "Utilities for doing gymnastics with files and directories", + documentation: "", + files: "", + group: "aplteam", + io: 0, + license: "MIT", + lx: "", + maintainer: "kai@aplteam.com", + minimumAplVersion: "18.0", + ml: 1, + name: "FilesAndDirs", + os_lin: 0, + os_mac: 0, + os_win: 1, + project_url: "https://github.com/aplteam/FilesAndDirs", + source: "APLSource/FilesAndDirs", + tags: "files,directories,copy,move,read,write,get,put", + uri: "https://tatin.dev/", + userCommandScript: "", + version: "5.6.0+153", +}