Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,24 @@
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Directories;
procedure EmptyDir is
function Empty (path : String) return String is
use Ada.Directories;
result : String := "Is empty.";
procedure check (ent : Directory_Entry_Type) is begin
if Simple_Name (ent) /= "." and Simple_Name (ent) /= ".." then
Empty.result := "Not empty";
end if;
end check;
begin
if not Exists (path) then return "Does not exist.";
elsif Kind (path) /= Directory then return "Not a Directory.";
end if;
Search (path, "", Process => check'Access);
return result;
end Empty;
begin
Put_Line (Empty ("."));
Put_Line (Empty ("./empty"));
Put_Line (Empty ("./emptydir.adb"));
Put_Line (Empty ("./foobar"));
end EmptyDir;

View file

@ -0,0 +1,10 @@
import gleam/io
import simplifile
pub fn main() {
case simplifile.read_directory("/somepath") {
Ok([]) -> io.println("Directory is empty")
Ok([_, ..]) -> io.println("Directory isn't empty")
Error(_) -> io.println("Some error")
}
}

View file

@ -0,0 +1,6 @@
$path = "C:\Users"
if((Dir $path).Count -eq 0) {
"$path is empty"
} else {
"$path is not empty"
}

View file

@ -0,0 +1 @@
print either empty? read %testdir/ ["empty"]["not empty"]

View file

@ -0,0 +1 @@
print either empty? read %testdir/ [print "empty"][print "not empty"]

View file

@ -0,0 +1,12 @@
Function IsDirEmpty(path)
IsDirEmpty = False
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(path)
If objFolder.Files.Count = 0 And objFolder.SubFolders.Count = 0 Then
IsDirEmpty = True
End If
End Function
'Test
WScript.StdOut.WriteLine IsDirEmpty("C:\Temp")
WScript.StdOut.WriteLine IsDirEmpty("C:\Temp\test")