Fork me on GitHub
#beginners
<
2024-02-12
>
Jim Newton17:02:29

How can I get the path name of a tmp file which I can write to which will work on all Operating Systems?

Jim Newton17:02:01

should be in something like /tmp for unix and whatever the corresponding place on windows is.

Nundrum17:02:46

I think (System/getProperty ".tmpdir") should do it.

1
Jim Newton17:02:13

found this one some random search

(java.io.File/createTempFile "filename" ".txt")

Nim Sadeh19:02:23

What do people use to manage deployments on Ubuntu (of an Uberjar)? I have tried both .service files and supervisorctl and have run into strange issues with both: 1. .service files/systemctl seems to expect the java process to detach immediately (I guess I could use nohup for that?) 2. supervisorctl logs a repeated exit every minute that isn't reported in the java process. Running the java process without the service layer runs fine so I have to imagine it's in the supervisortcl layer, but I can't find the cause in the logs

hiredman20:02:02

.service files expect the opposite, unless you specifically say you are defining a forking service, the service will stop once the process it starts has exited

hiredman20:02:56

For a non-forking service if you fork the service will stop, for a forking service if you don't fork, I forget what happens but I believe systemd at least complains about

hiredman20:02:11

The thing to do is just don't make a forking service and don't fork

Nim Sadeh20:02:21

Got it thanks!

hrtmt brng20:02:19

How can I define a string that contains a double quote? Sorry, for that simple question. It is a bit emberrasing, but I really find no answer.

hrtmt brng20:02:15

Ah. Thanks! Now I found out what I made wrong. (prn "\"a\"") works differently than (print "\"a\""). That confused me so much that I thought, I as completely wrong.

Alex Miller (Clojure team)20:02:04

yes, prn is for printing readable data, println is for humans