public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Working with string keys in a java.util.Map
@ 2020-07-03 21:46 Duncan Mak
  2020-07-03 21:52 ` Sudarshan S Chawathe
  0 siblings, 1 reply; 7+ messages in thread
From: Duncan Mak @ 2020-07-03 21:46 UTC (permalink / raw)
  To: kawa mailing list

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-04  5:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 21:46 Working with string keys in a java.util.Map Duncan Mak
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

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).