<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Sep 2, 2008 at 6:42 PM, Hamish <span dir="ltr">&lt;<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jamie Adams &lt;<a href="mailto:jaadfoo@gmail.com">jaadfoo@gmail.com</a>&gt;<br>
<div class="Ih2E3d">&gt; I&#39;ve got over 14k rasters in several mapsets that I need to store<br>
&gt; modified date in a db for tracking purposes. &nbsp;I&#39;ve got the<br>
&gt; storage and retrieval worked out, but I don&#39;t see an clean (easy)<br>
&gt; way to get the modified date via a python script.<br>
</div>....<br>
<div class="Ih2E3d">&gt; Is there a more efficient way of getting the modified date<br>
&gt; of a raster layer? &nbsp;If not, getting the full path instead?<br>
<br>
<br>
</div>MAP=roads<br>
eval `g.findfile element=hist file=&quot;$MAP&quot;`<br>
head -n 1 &quot;$file&quot;<br>
<br>
It&#39;s stored as a text string; what you see is what you get.<br>
<br>
see also r.timestamp, but that is for map metadata not file creation<br>
timestamp.<br>
<div class="Ih2E3d"><br>
<br>
&gt; os.stat (python) - has a nice date integer format, but it<br>
&gt; requires that I have the full path to the cellhd folder.<br>
<br>
</div>use g.findfile for that.</blockquote><div><br>Ah okay, I never really understood that command.&nbsp; &quot;g.findfile element=cell file=&lt;filename&gt; | grep ^file&quot; returns what I need.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<div class="Ih2E3d"><br>
<br>
&gt; Database and location are easy via g.gisenv, but getting the mapset<br>
&gt; on an individual layer basis isn&#39;t completely straightforward.<br>
<br>
&gt; I can use use &quot;g.mlist -m rast pattern=&lt;filename&gt;&quot;, but that<br>
&gt; essentially greps it out of a full list.<br>
<br>
</div>I don&#39;t fully understand what you mean by those two.</blockquote><div>&nbsp;</div><div>Yeah, it&#39;s a bit tough to explain with my processing setup.&nbsp; It&#39;s a non-issue now, g.findfile solved it.&nbsp; Thanks!<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<font color="#888888"><br>
<br>
Hamish<br>
<br>
<br>
<br>
<br>
<br>
</font></blockquote></div><br></div>