<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/4089" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-04-09T14:58:28-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/4089</id>

		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-09T14:58:28-04:00</updated>

		<published>2003-04-09T14:58:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18798#p18798</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18798#p18798"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18798#p18798"><![CDATA[
Well, they all work now. the Time code you suggested ended up giving me a heap of errors, so i dipped into the [clock format (variable) -format %c] option <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><blockquote class="uncited"><div>[19:48:56] -Natsuki-Chan- Pic of the Day is filesys/incoming/521.jpg -- File information: &lt;Directory - filesys/incoming&gt; &lt;Access Time - 09 April 2003 19:37:01&gt; &lt;Isfile - 1&gt; &lt;Total File - filesys/incoming/test.jpg&gt;<br>[19:48:58] -Natsuki-Chan- &lt;Modified - 09 April 2003 04:07:24&gt; &lt;Stat - 128246bytes,  33188, file, 0&gt; &lt;system - native NTFS&gt; &lt;system volumes - C:/ D:/ E:/ F:/ G:/ H:/ I:/ J:/&gt;<br>[19:50:08] &lt;Weirdo|TCL&gt; [19:37:01] &lt;Natsuki-Chan&gt; [19:37] Finished dcc send 521.jpg to Cmosrunner<br>[19:50:18] &lt;Weirdo|TCL&gt; and its identical <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>[19:50:25] &lt;Weirdo|TCL&gt; Access time = when DCC Send finishes</div></blockquote>The Stats script also works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Now, all i have to do is the actual scanning of a directory, perhaps use a while loop to write a single line at a time into a text file. This b the fun bit <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Wed Apr 09, 2003 2:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-04-09T13:58:09-04:00</updated>

		<published>2003-04-09T13:58:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18796#p18796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18796#p18796"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18796#p18796"><![CDATA[
In tcl syntax, putting ?? around a variable means it's optional. E.g., you can call it either<br><br>file atime &lt;name&gt;<br><br>or<br><br>file atime &lt;name&gt; &lt;time&gt;<br><br>As the docs say, the first one simply returns the access time, the 2nd one sets it.<br><br>Your second problem with stats maybe arises from a similar misunderstanding. It wants you to pass the name of an array, not the array itself. So if 'dir' is your array variable, you would say<br><br>file stat $picoday dir<br><br>That command will set elements of dir, such as dir(atime), dir(ctime), dir(dev). You could get rid of your own lines that set dir(atime) and dir(mtime) because this command will do it for you.<br><br>A final tip: the times stored in dir(atime), dir(mtime), etc, are in unix timestamp format. You can convert them to a human-readable time/date using, set timestr [clock scan $dir(mtime)] (or whatever var you want). Check the clock command for tips on how to customize the string.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Apr 09, 2003 1:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-09T13:26:20-04:00</updated>

		<published>2003-04-09T13:26:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18794#p18794</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18794#p18794"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18794#p18794"><![CDATA[
Stdragon, thanks a lot for the little linkie to the manual, the file command is quite extensive <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>So, made some variables using the various commands, chucked them into one of the scripts i use on the channel and using the code below, it does work... bar two<br><br>the command " File atime &lt;name&gt; &lt;time&gt;" confuses me, in the help file it says this..<blockquote class="uncited"><div>file atime name ?time?<br>Returns a decimal string giving the time at which file name was last accessed. If time is specified, it is an access time to set for the file. The time is measured in the standard POSIX fashion as seconds from a fixed starting time (often January 1, 1970). If the file doesn't exist or its access time cannot be queried or set then an error is generated. On Windows, FAT file systems do not support access time. </div></blockquote>But what does it mean by ?time?, not sure what it is, is it a variable to put the time in?<br><br>Same problem with the "file stat name varName" . Now i understand that this creates a series of results, that need to be put into an array<blockquote class="uncited"><div>VarName is treated as an array variable, and the following elements of that variable are set: atime, ctime, dev, gid, ino, mode, mtime, nlink, size, type, uid.</div></blockquote>Yet, when i place a name of a used array, dir() in the case of this script, it gives me various errors about elements in arrays, and the fact that if i specify a variable in the brackets in dir(), it cannot be put in, i just put dir in, and it wont use it. What do i need to do to get this working?<br><br>On a lighter note, removing the references to these give me the nice little result of...<blockquote class="uncited"><div>[18:06:06] &lt;Weirdo|SimCity&gt; !picoday<br>[18:06:08] -Natsuki-Chan- Pic of the Day is filesys/incoming/c23427sample7.jpg -- File information: &lt;Directory - filesys/incoming&gt; &lt;Isfile - 1&gt; &lt;Total File - filesys/incoming/test.jpg&gt;<br>[18:06:10] -Natsuki-Chan- &lt;Modified - 1049746511&gt; &lt;system - native NTFS&gt; &lt;system volumes - C:/ D:/ E:/ F:/ G:/ H:/ I:/ J:/&gt;</div></blockquote>Which makes me damn happy and fills my little mind with future scripting ideas <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>#set dir(atime) [file atime $picoday time]set dir(dir) [file dirname $picoday]set dir(isfile) [file isfile $picoday]set dir(join) [file join $dir(main) $dir(filename2)]set dir(mtime) [file mtime $picoday]#set dir(stat) [file stat $dir()]set dir(system) [file system $picoday]set dir(volumes) [file volumes]puthelp "notice $nick :Pic of the Day is $picoday -- File information: &lt;Directory - $dir(dir)&gt; &lt;Isfile - $dir(isfile)&gt; &lt;Total File - $dir(join)&gt;"puthelp "notice $nick :&lt;Modified - $dir(mtime)&gt; &lt;system - $dir(system)&gt; &lt;system volumes - $dir(volumes)&gt;"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Wed Apr 09, 2003 1:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-04-08T16:57:22-04:00</updated>

		<published>2003-04-08T16:57:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18750#p18750</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18750#p18750"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18750#p18750"><![CDATA[
<a href="http://www.tcl.tk" class="postlink">www.tcl.tk</a> has all the manuals in the documentation section<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Apr 08, 2003 4:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-08T16:45:32-04:00</updated>

		<published>2003-04-08T16:45:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18748#p18748</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18748#p18748"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18748#p18748"><![CDATA[
TCL manual, rather than Eggdrop tcl manual? where ca i get it for lib8.4?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Tue Apr 08, 2003 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-04-08T16:43:52-04:00</updated>

		<published>2003-04-08T16:43:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18747#p18747</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18747#p18747"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18747#p18747"><![CDATA[
Weirdo, to get information about the file, use the "file" command. There are subcommands to find out things like access time, modification time, etc. Check the tcl manual.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Apr 08, 2003 4:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-08T15:28:25-04:00</updated>

		<published>2003-04-08T15:28:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18744#p18744</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18744#p18744"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18744#p18744"><![CDATA[
Also you can see <a href="http://forum.egghelp.org/viewtopic.php?t=3465" class="postlink">this</a> post and <a href="http://www.geocities.com/caesartcl/archive/thing.tcl.txt" class="postlink">this</a> tcl I've did to add, delete and list stuff from an file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 08, 2003 3:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-08T15:10:28-04:00</updated>

		<published>2003-04-08T15:10:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18741#p18741</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18741#p18741"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18741#p18741"><![CDATA[
Ah, must have missed that one when i did my search. Thank you caesar <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>How can you get the information about the files? For example the date modified?<br><br>I am assuming the Extension is included with the name. shoudl be easy enough to create a loop to write the output to a line (i hope <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Tue Apr 08, 2003 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-08T15:08:16-04:00</updated>

		<published>2003-04-08T15:08:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18740#p18740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18740#p18740"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18740#p18740"><![CDATA[
You should use the search feature of the forum. If I remember corectly, you should find some answers to your questions. One of them is <a href="http://forum.egghelp.org/viewtopic.php?t=4044" class="postlink">this</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 08, 2003 3:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-08T14:22:15-04:00</updated>

		<published>2003-04-08T14:22:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18736#p18736</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18736#p18736"/>
		<title type="html"><![CDATA[Creating List of Files in a Directory]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18736#p18736"><![CDATA[
Kind of at a dead loss here. Cant find anything on how to seriously create a text file, and add lines for each file that is in that directory. <br><br>Does anyone have any ideas/links which give information on tcl commands that will be able to do this?<br><br>Thought a bit on how i would like to do it. Basically involving probably a loop, that would write a new line, then find the next file sorted by date or alphabetical order, and insert the info for that file. <br><br>Info for that file being Name of the File &lt;tab&gt; Date created<br><br>IE, if the directory is reverse sorted by date, it will do them in sort of order. Most definately the most difficult idea i have ever come across. Gonna be interesting to see if i can actually write the code. <br><br>Thanks if you can help me in any way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Weirdo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Tue Apr 08, 2003 2:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
