diff options
| author | EverythingWindows <[email protected]> | 2022-11-17 11:11:51 +0700 |
|---|---|---|
| committer | EverythingWindows <[email protected]> | 2022-11-17 11:11:51 +0700 |
| commit | f9c724e547a659671174d264ba74603ac8227b6e (patch) | |
| tree | 88cd2fc58de670ec931c9be81ca01f7adf7927a3 /ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb | |
| parent | b6ad60f56854bdf720c1e7177f011329048516db (diff) | |
| download | shiftos-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/Internal/Com_Dir.vb')
| -rw-r--r-- | ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb | 46 |
1 files changed, 46 insertions, 0 deletions
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 |
