From: Jarmo on 16 Feb 2010 14:56 sreservoir <sreservoir(a)gmail.com> wrote: > strftime("~/foobarlogs/foobar%Y-%m-%d-%H-%M-%S.log", gmtime); That is a nice and simple way to get the date and time compared to monster I was working on... > though I doubt what you want is a directory named ~. No, I don't. Not sure how that got there in the first place as ~ isn't even close to " or / on my keyboard. -- Jampe ---------------------------------------------------------------- Things are getting worse. Please send chocolate. ----------------------------------------------------------------
From: Frank Seitz on 16 Feb 2010 15:01 Helmut Richter wrote: > On Tue, 16 Feb 2010, Frank Seitz wrote: >>> ln -s foobar.log foobar[whateverthenewdayis] >> >> A symlink is obviously not a solution, because the file >> gets overwritten with every run. > > The other way would work: > > Every night: > rm foobar.log > ln -s foobar[whateverthenewdayis] foobar.log No, but a hardlink (ln without -s) or cp would do it. Frank -- Dipl.-Inform. Frank Seitz Anwendungen f�r Ihr Internet und Intranet Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel Blog: http://www.fseitz.de/blog XING-Profil: http://www.xing.com/profile/Frank_Seitz2
From: Jarmo Sillanpaa on 16 Feb 2010 15:19 RedGrittyBrick <RedGrittyBrick(a)spamweary.invalid> wrote: > The obvious (to me) answer is not to run the program directly but run it > from a script. The script can rename the logfile after the program exits. I didn't consider that an option at first because I have several different people running the program at random times and I didn't think I could count on them remembering to start using a new command to start it. Now reading this I had an idea that I could rename the original executable and make the script with the original name. I think that is what I will do. -- Jampe ---------------------------------------------------------------- Things are getting worse. Please send chocolate. ----------------------------------------------------------------
From: Jarmo Sillanpaa on 16 Feb 2010 15:22 Thanks for answers. I went with a different implementation although I am still curious if it is possible to do what I was thinking about first. -- Jampe ---------------------------------------------------------------- Things are getting worse. Please send chocolate. ----------------------------------------------------------------
From: Peter J. Holzer on 16 Feb 2010 15:15 On 2010-02-16 19:56, Jarmo <jampe(a)darkbusstop.com> wrote: > sreservoir <sreservoir(a)gmail.com> wrote: > >> strftime("~/foobarlogs/foobar%Y-%m-%d-%H-%M-%S.log", gmtime); > > That is a nice and simple way to get the date and time compared to monster > I was working on... > >> though I doubt what you want is a directory named ~. > > No, I don't. Not sure how that got there in the first place as ~ isn't even > close to " or / on my keyboard. ~ is an abbreviation for the home directory in most shells. So in Perl that would be: $ENV{HOME} . strftime("/foobarlogs/foobar%Y-%m-%d-%H-%M-%S.log", gmtime); hp
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: readdir: is there a way to reset cursor to beginning? Next: FAQ 3.9 Is there a ctags for Perl? |