Getting a safe path for a temporary file

2015-01-17 Thread via Digitalmars-d-learn
Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to be freshly created and will not override another existing file? There's `std.file.tempDir`, which doesn't create a unique file. Then there's `std.stdio.tmpfile()`, which does, but it returns a

Re: Getting a safe path for a temporary file

2015-01-17 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 17 January 2015 at 13:47:39 UTC, Marc Schütz wrote: Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to be freshly created and will not override another existing file? There's `std.file.tempDir`, which doesn't create a unique file.

Re: Getting a safe path for a temporary file

2015-01-17 Thread via Digitalmars-d-learn
On Saturday, 17 January 2015 at 14:37:00 UTC, Laeeth Isharc wrote: On Saturday, 17 January 2015 at 13:47:39 UTC, Marc Schütz wrote: Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to be freshly created and will not override another existing file?

Re: Getting a safe path for a temporary file

2015-01-17 Thread Tobias Pankrath via Digitalmars-d-learn
On Saturday, 17 January 2015 at 16:55:42 UTC, Marc Schütz wrote: On Saturday, 17 January 2015 at 14:37:00 UTC, Laeeth Isharc wrote: On Saturday, 17 January 2015 at 13:47:39 UTC, Marc Schütz wrote: Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to

Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Hey, all. I have just started using D and I'm really loving it, but I have been caught on a problem. I am trying to share my Client class to a new thread, and after a bit of struggling: I finally got the code to compile! Now I am having a new problem: the moment I call client.receive(buf) I get

Re: Struggling with shared objects

2015-01-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, January 17, 2015 21:56:56 Mike via Digitalmars-d-learn wrote: Ha, I am so stupid! I forgot to call the socket member before receive! Thank you for the help. I have also removed the pointers. I am now getting this: C:\Users\Michael\Documents\Projects\StompBroker\StompBrokerdmd

Re: Struggling with shared objects

2015-01-17 Thread Vlad Levenfeld via Digitalmars-d-learn
That's real weird. In D:\D\dmd2\src\phobos\std\concurrency.d(13,13) 13,13 isn't a line number and static assertions should go off during compilation, not runtime.

Re: Struggling with shared objects

2015-01-17 Thread anonymous via Digitalmars-d-learn
On Saturday, 17 January 2015 at 21:00:34 UTC, Mike wrote: Hey, all. I have just started using D and I'm really loving it, but I have been caught on a problem. I am trying to share my Client class to a new thread, and after a bit of struggling: I finally got the code to compile! Now I am

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Ha, I am so stupid! I forgot to call the socket member before receive! Thank you for the help. I have also removed the pointers. I am now getting this: C:\Users\Michael\Documents\Projects\StompBroker\StompBrokerdmd main.d main.d(11): Error: None of the overloads of 'receive' are callable

Re: Getting a safe path for a temporary file

2015-01-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, January 17, 2015 13:47:37 via Digitalmars-d-learn wrote: Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to be freshly created and will not override another existing file? There's `std.file.tempDir`, which doesn't create a unique

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
On Saturday, 17 January 2015 at 21:12:34 UTC, Vlad Levenfeld wrote: That's real weird. In D:\D\dmd2\src\phobos\std\concurrency.d(13,13) 13,13 isn't a line number and static assertions should go off during compilation, not runtime. It is during compilation. When I run dmd myself, I get this:

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Oh, I said the moment I call I should have reworded that. I meant that the moment I add that line to the code, I get the error. Sorry!

Re: Struggling with shared objects

2015-01-17 Thread Mike via Digitalmars-d-learn
Thank you so much! I got it all working now. You're definitely right, that is still easier than C++.

Re: Getting a safe path for a temporary file

2015-01-17 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 17 January 2015 at 16:55:42 UTC, Marc Schütz wrote: On Saturday, 17 January 2015 at 14:37:00 UTC, Laeeth Isharc wrote: On Saturday, 17 January 2015 at 13:47:39 UTC, Marc Schütz wrote: Is it currently possible to get the path to a safe temporary file, i.e. one that is guaranteed to