From: Duncan Mak <duncanmak@gmail.com>
To: kawa mailing list <kawa@sourceware.org>
Subject: Working with string keys in a java.util.Map
Date: Fri, 3 Jul 2020 17:46:19 -0400 [thread overview]
Message-ID: <CABgWrqrETRMdLoEmwyrCRFrDJ9=sk4BJ3W-91XAABkiXDJWS0w@mail.gmail.com> (raw)
Hello all,
I've been playing around with the java.nio APIs.
Using Files:readAttributes, you can get a Map<String, Object> of attributes.
#|kawa:80|# attrs
{owner=duncan, lastAccessTime=2020-07-03T00:12:53.682826Z,
lastModifiedTime=2019-04-22T18:53:02.529968Z, gid=20,
creationTime=2019-04-22T18:53:02Z, isRegularFile=true, nlink=1,
fileKey=(dev=1000007,ino=12896309012), ino=12896309012, mode=33261,
uid=501, size=20799, dev=16777223, isSymbolicLink=false,
permissions=[GROUP_READ, OWNER_READ, OTHERS_READ, OTHERS_EXECUTE,
OWNER_WRITE, GROUP_EXECUTE, OWNER_EXECUTE], rdev=0,
ctime=2019-04-22T18:53:02.533688Z, isOther=false, isDirectory=false,
group=staff}
#|kawa:81|# (attrs:containsKey "owner")
#f
#|kawa:82|# (attrs:get "owner")
#!null
#|kawa:83|# (attrs:get "gid")
#!null
I think this is failing because the literal string that I typed in is a
gnu.lists.IString (https://www.gnu.org/software/kawa/Strings.html) and I
don't see a function to force any one of Kawa's many string representations
into a java.lang.String.
--
Duncan.
next reply other threads:[~2020-07-03 21:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 21:46 Duncan Mak [this message]
2020-07-03 21:52 ` Sudarshan S Chawathe
2020-07-03 22:33 ` Per Bothner
2020-07-04 1:30 ` Jamison Hope
2020-07-04 4:04 ` Duncan Mak
2020-07-04 4:29 ` Sudarshan S Chawathe
2020-07-04 5:24 ` Per Bothner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABgWrqrETRMdLoEmwyrCRFrDJ9=sk4BJ3W-91XAABkiXDJWS0w@mail.gmail.com' \
--to=duncanmak@gmail.com \
--cc=kawa@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).