aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/TerminalApplications
diff options
context:
space:
mode:
authorEverythingWindows <[email protected]>2022-11-17 11:11:51 +0700
committerEverythingWindows <[email protected]>2022-11-17 11:11:51 +0700
commitf9c724e547a659671174d264ba74603ac8227b6e (patch)
tree88cd2fc58de670ec931c9be81ca01f7adf7927a3 /ShiftOS-TheRevival/TerminalApplications
parentb6ad60f56854bdf720c1e7177f011329048516db (diff)
downloadshiftos-therevival-old-f9c724e547a659671174d264ba74603ac8227b6e.tar.gz
shiftos-therevival-old-f9c724e547a659671174d264ba74603ac8227b6e.tar.bz2
shiftos-therevival-old-f9c724e547a659671174d264ba74603ac8227b6e.zip
moving from DirectoryManagement to each modules for DE's other module for said action.
Diffstat (limited to 'ShiftOS-TheRevival/TerminalApplications')
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb19
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb5
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb3
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb46
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb9
-rw-r--r--ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb13
6 files changed, 92 insertions, 3 deletions
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb
new file mode 100644
index 0000000..479d050
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb
@@ -0,0 +1,19 @@
+Module Com_Cd
+ Public Sub NavigateDir(TheDirectory As String)
+ If TheDirectory = ".." Then
+ If Console.CurrentDirectory = Strings.OnceInfo(1) Then
+ NewLine("!\")
+ Else
+ Console.CurrentDirectory = IO.Directory.GetParent(Console.CurrentDirectory).ToString
+ End If
+ Else
+ If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then
+ Console.CurrentDirectory = Console.CurrentDirectory & "\" & TheDirectory
+ ElseIf IO.Directory.Exists(TheDirectory) Then
+ Console.CurrentDirectory = TheDirectory
+ Else
+ NewLine("The directory is not exist!")
+ End If
+ End If
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb
new file mode 100644
index 0000000..0a22401
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb
@@ -0,0 +1,5 @@
+Module Com_Clear
+ Public Sub Clear()
+ Console.TextBox1.Text = Nothing
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb
deleted file mode 100644
index ac9d52e..0000000
--- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb
+++ /dev/null
@@ -1,3 +0,0 @@
-Module Com_Color
-
-End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb
new file mode 100644
index 0000000..d697c32
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb
@@ -0,0 +1,46 @@
+Module Com_Dir
+ Dim spaces As String
+
+ Public Sub TerminalDirectories(TheDirectory As String)
+ Console.Pseudodir = TheDirectory.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS", "!")
+ NewLine("Contents of " & Console.Pseudodir)
+ NewLine(Nothing)
+ NewLine("[DIR] 0 KB .")
+ NewLine("[DIR] 0 KB ..")
+ For Each Dir As String In IO.Directory.GetDirectories(TheDirectory)
+ Dim dirinf As New IO.DirectoryInfo(Dir)
+ NewLine("[DIR] 0 KB " & dirinf.Name)
+ Next
+ For Each file As String In IO.Directory.GetFiles(TheDirectory)
+ Dim filinf As New IO.FileInfo(file)
+ Dim filsize As Long = filinf.Length / 1024
+ Dim thesize As Integer = 1
+ Do
+ If filsize >= 1024 Then
+ filsize = filsize / 1024
+ thesize = thesize + 1
+ Else
+ Exit Do
+ End If
+ Loop
+ Select Case filsize
+ Case 0 To 9
+ spaces = " "
+ Case 10 To 99
+ spaces = " "
+ Case 100 To 999
+ spaces = " "
+ Case 1000 To 1023
+ spaces = " "
+ End Select
+ Select Case thesize
+ Case 1
+ NewLine(spaces & filsize & " KB " & filinf.Name)
+ Case 2
+ NewLine(spaces & filsize & " MB " & filinf.Name)
+ Case 3
+ NewLine(spaces & filsize & " GB " & filinf.Name)
+ End Select
+ Next
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb
new file mode 100644
index 0000000..2943916
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb
@@ -0,0 +1,9 @@
+Module Com_Mkdir
+ Public Sub CreateDir(TheDirectory As String)
+ If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then
+ NewLine("Directory is already exists!")
+ Else
+ IO.Directory.CreateDirectory(Console.CurrentDirectory + "\" + TheDirectory)
+ End If
+ End Sub
+End Module
diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb
new file mode 100644
index 0000000..1d1754f
--- /dev/null
+++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb
@@ -0,0 +1,13 @@
+Module Com_Rmdir
+ Public Sub RemoveDir(TheDirectory As String)
+ If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then
+ Try
+ IO.Directory.Delete(Console.CurrentDirectory + "\" + TheDirectory)
+ Catch ex As Exception
+ NewLine(ex.Message)
+ End Try
+ Else
+ NewLine("The directory is not exists!")
+ End If
+ End Sub
+End Module