]> gitweb.factorcode.org Git - factor.git/commitdiff
drive-strings: move to windows.drive-strings.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 13 Apr 2020 19:43:25 +0000 (12:43 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 13 Apr 2020 19:43:25 +0000 (12:43 -0700)
extra/windows/drive-strings/authors.txt [new file with mode: 0644]
extra/windows/drive-strings/drive-strings.factor [new file with mode: 0644]
extra/windows/drive-strings/platforms.txt [new file with mode: 0644]

diff --git a/extra/windows/drive-strings/authors.txt b/extra/windows/drive-strings/authors.txt
new file mode 100644 (file)
index 0000000..8e1955f
--- /dev/null
@@ -0,0 +1 @@
+Alexander Ilin
diff --git a/extra/windows/drive-strings/drive-strings.factor b/extra/windows/drive-strings/drive-strings.factor
new file mode 100644 (file)
index 0000000..a1dd4ad
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2019 Alexander Ilin.
+! See http://factorcode.org/license.txt for BSD license.
+USING: byte-arrays io.encodings.string io.encodings.utf16
+kernel math sequences splitting windows.kernel32 ;
+IN: windows.drive-strings
+
+: logical-drive-strings ( -- seq )
+    30 4 2 * * dup <byte-array> [ GetLogicalDriveStrings ] keep
+    utf16le decode swap head "\0" split harvest ;
diff --git a/extra/windows/drive-strings/platforms.txt b/extra/windows/drive-strings/platforms.txt
new file mode 100644 (file)
index 0000000..8e1a559
--- /dev/null
@@ -0,0 +1 @@
+windows