Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
32
Task/Unix-ls/Ada/unix-ls.adb
Normal file
32
Task/Unix-ls/Ada/unix-ls.adb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
with Ada.Text_IO, Ada.Directories, Ada.Containers.Indefinite_Vectors;
|
||||
|
||||
procedure Directory_List is
|
||||
|
||||
use Ada.Directories, Ada.Text_IO;
|
||||
Search: Search_Type; Found: Directory_Entry_Type;
|
||||
package SV is new Ada.Containers.Indefinite_Vectors(Natural, String);
|
||||
Result: SV.Vector;
|
||||
package Sorting is new SV.Generic_Sorting; use Sorting;
|
||||
function SName return String is (Simple_Name(Found));
|
||||
|
||||
begin
|
||||
-- search directory and store it in Result, a vector of strings
|
||||
Start_Search(Search, Directory => ".", Pattern =>"");
|
||||
while More_Entries(Search) loop
|
||||
Get_Next_Entry(Search, Found);
|
||||
declare
|
||||
Name: String := Simple_Name(Found);
|
||||
begin
|
||||
if Name(Name'First) /= '.' then
|
||||
Result.Append(Name);
|
||||
end if; -- ingnore filenames beginning with "."
|
||||
end;
|
||||
end loop; -- Result holds the entire directory in arbitrary order
|
||||
|
||||
Sort(Result); -- Result holds the directory in proper order
|
||||
|
||||
-- print Result
|
||||
for I in Result.First_Index .. Result.Last_Index loop
|
||||
Put_Line(Result.Element(I));
|
||||
end loop;
|
||||
end Directory_List;
|
||||
4
Task/Unix-ls/Batch-File/unix-ls-1.bat
Normal file
4
Task/Unix-ls/Batch-File/unix-ls-1.bat
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
setlocal
|
||||
pushd %1
|
||||
for %%a in (*) do @echo:%%a
|
||||
1
Task/Unix-ls/Batch-File/unix-ls-2.bat
Normal file
1
Task/Unix-ls/Batch-File/unix-ls-2.bat
Normal file
|
|
@ -0,0 +1 @@
|
|||
for %a in (*) do @echo:%a
|
||||
4
Task/Unix-ls/Icon/unix-ls.icon
Normal file
4
Task/Unix-ls/Icon/unix-ls.icon
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
procedure main()
|
||||
every (a := [], put(a,!(f := open(".")))|close(f))
|
||||
every write(!sort(a))
|
||||
end
|
||||
5
Task/Unix-ls/PowerShell/unix-ls.ps1
Normal file
5
Task/Unix-ls/PowerShell/unix-ls.ps1
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Prints Name, Length, Mode, and LastWriteTime
|
||||
Get-ChildItem | Sort-Object Name | Write-Output
|
||||
|
||||
# Prints only the name of each file in the directory
|
||||
Get-ChildItem | Sort-Object Name | ForEach-Object Name | Write-Output
|
||||
3
Task/Unix-ls/Unicon/unix-ls.unicon
Normal file
3
Task/Unix-ls/Unicon/unix-ls.unicon
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
procedure main()
|
||||
every write(!sort([: !(f := open(".")) :])) | close(f)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue