: factor-bundle-subdir ( path -- path )
factor-bundle-name append-path ;
-: first-existing ( paths -- path )
- [ file-exists? ] find nip
- [ "no user cache directory found" throw ] unless* ; inline
+: first-existing ( paths -- path/f )
+ [ file-exists? ] find nip ; inline
PRIVATE>
M: macosx default-cache-directory
NSCachesDirectory NSUserDomainMask 1 NSSearchPathForDirectoriesInDomains
- plist> first-existing factor-bundle-subdir ;
+ plist> first-existing [ call-next-method ] unless* factor-bundle-subdir ;
! Copyright (C) 2012 Joe Groff.
! See https://factorcode.org/license.txt for BSD license.
-USING: environment io.files.temp io.pathnames sequences system
-xdg ;
+USING: environment io.files.temp io.pathnames kernel sequences
+system vocabs xdg ;
IN: io.files.temp.unix
M: unix default-temp-directory
M: unix default-cache-directory
xdg-cache-home "factor" append-path absolute-path ;
+
+os macosx? [ "io.files.temp.macosx" require ] when