From 97b07d9972e02876252b072b222b59866d6c856e Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Fri, 9 Aug 2019 08:20:00 +0200 Subject: [PATCH] drive-strings: add a demo vocab for GetLogicalDriveStrings to extra --- extra/drive-strings/authors.txt | 1 + extra/drive-strings/drive-strings.factor | 9 +++++++++ extra/drive-strings/platforms.txt | 1 + 3 files changed, 11 insertions(+) create mode 100644 extra/drive-strings/authors.txt create mode 100644 extra/drive-strings/drive-strings.factor create mode 100644 extra/drive-strings/platforms.txt diff --git a/extra/drive-strings/authors.txt b/extra/drive-strings/authors.txt new file mode 100644 index 0000000000..8e1955f8e1 --- /dev/null +++ b/extra/drive-strings/authors.txt @@ -0,0 +1 @@ +Alexander Ilin diff --git a/extra/drive-strings/drive-strings.factor b/extra/drive-strings/drive-strings.factor new file mode 100644 index 0000000000..d436a8a6d5 --- /dev/null +++ b/extra/drive-strings/drive-strings.factor @@ -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: drive-strings + +: logical-drive-strings ( -- seq ) + 30 4 2 * * dup [ GetLogicalDriveStrings ] keep + utf16le decode swap head "\0" split harvest ; diff --git a/extra/drive-strings/platforms.txt b/extra/drive-strings/platforms.txt new file mode 100644 index 0000000000..8e1a55995e --- /dev/null +++ b/extra/drive-strings/platforms.txt @@ -0,0 +1 @@ +windows