help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writing the time to an output file


From: James Sherman Jr.
Subject: Re: writing the time to an output file
Date: Wed, 15 Aug 2007 16:28:04 -0400

Same way you write any string to a file? ;)

So, something like,
fid = fopen("filename", "w");
timestr = strftime ("%e %B %Y at %R", localtime (time ()));
fprintf(fid, timestr);
fclose(fid);

I don't have access to octave to test this for any typos, but this should be the general idea.  Also, if you want to add something to the end of file (and not overwrite it) use "a" instead of "w".  Also, you should probably check that fid ~= -1 since there maybe errors when opening a file.

James Sherman

On 8/15/07, address@hidden <address@hidden > wrote:
Hello,
how to write the output of this command to a file?
     strftime ("%e %B %Y at %R", localtime (time ()))

Thanks in advance ..
oxy.
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]