<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: javascript filetype &quot;fold&quot;</title>
		<atom:link href="http://cycling74.com/forums/topic/javascript-filetype-fold/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/javascript-filetype-fold/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 21:02:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-24590</guid>
					<title><![CDATA[javascript filetype &quot;fold&quot;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-24590</link>
					<pubDate>Thu, 23 Feb 2006 22:27:17 +0000</pubDate>
					<dc:creator>batchku</dc:creator>

					<description>
						<![CDATA[
						<p>hello,<br />
i learned from the js example &#8220;jsfolderiter.js&#8221; that a File object&#8217;s type would be &#8220;fold&#8221; if the file is a directory.  However, i&#8217;m finding that i get a blank filetype for folders.  I&#8217;m also noticing that .xml files return a blank filetype where as according to &#8220;max-fileformats.txt&#8221; they should return TEXT.</p>
<p>js is attached.<br />
please put some .txt, a .pat, and/or a .xml  in your root folder to test it out. </p>
<p>patch is below.</p>
<p>thanks,</p>
<p>ali</p>
<p>max v2;<br />
#N vpatcher 40 104 640 504;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P number 164 60 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window linecount 1;<br />
#P message 165 90 54 196617 getfile $1;<br />
#P message 60 86 84 196617 foldercontents /;<br />
#P newex 84 175 105 196617 js js-filetype-fold.js;<br />
#P connect 1 0 0 0;<br />
#P connect 2 0 0 0;<br />
#P connect 3 0 2 0;<br />
#P pop;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71380</guid>
					<title><![CDATA[Re: javascript filetype &#8220;fold&#8221;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71380</link>
					<pubDate>Thu, 23 Feb 2006 23:36:49 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>No js was provided. As always, please also provide detailed system  <br />
and max versions, and specific usage with any report.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71381</guid>
					<title><![CDATA[Re: javascript filetype &#8220;fold&#8221;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71381</link>
					<pubDate>Thu, 23 Feb 2006 23:42:53 +0000</pubDate>
					<dc:creator>batchku</dc:creator>

					<description>
						<![CDATA[
						<p>weird, i&#8217;m using the web-interface for the forum and was pressing on &#8220;upload file&#8221; after choosing the file.<br />
perhaps that&#8217;s not the thing to do..  let&#8217;s try again.</p>
<p>max 4.5.6, os x 10.4.5</p>
<p>just in case, here&#8217;s the js:</p>
<p>
____________</p>
<p>var filelist = new Array();</p>
<p>function foldercontents(mypath)<br />
{<br />
	//post(mypath,&#8221;n&#8221;);<br />
	var myfolder = new Folder(mypath);<br />
	// myfolder.reset();<br />
	filelist = new Array();<br />
	var counter = 0;<br />
	while (!myfolder.end) {<br />
		post(myfolder.filename);<br />
		post();<br />
		filelist[counter]= new File(myfolder.filename);<br />
		var thisfile = new File(myfolder.filename);<br />
		post(&#8220;file type is: &#8220;,thisfile.filetype);<br />
		post();<br />
		counter = counter + 1;<br />
		myfolder.next();<br />
	}<br />
	myfolder.close();<br />
}</p>
<p>function getfile(n)<br />
{<br />
	post(&#8220;file name: &#8220;,filelist[n].filename);<br />
	post();<br />
	post(&#8220;file type: &#8220;,filelist[n].filetype);<br />
	post();<br />
	post(&#8220;folder path: &#8220;,filelist[n].foldername);<br />
	post();</p>
<p>}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71382</guid>
					<title><![CDATA[Re: javascript filetype &#8220;fold&#8221;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71382</link>
					<pubDate>Fri, 24 Feb 2006 00:02:58 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Feb 23, 2006, at 3:42 PM, Ali Momeni wrote:</p>
<p>> weird, i&#8217;m using the web-interface for the forum and was pressing  <br />
> on &#8220;upload file&#8221; after choosing the file.<br />
> perhaps that&#8217;s not the thing to do..  let&#8217;s try again.</p>
<p>
Okay. Please note that you&#8217;re not following the jsfolderiter  <br />
example,l which clearly demostrates that the filetype tested is an  <br />
attribute of the *Folder* object rather than the *File* object. I  <br />
believe this should solve your problems. You cannot open a folder as  <br />
a file.</p>
<p>In general, I would recommend whenever you have a problem like this,  <br />
scrutinizing the differences between the working example and your  <br />
file. C&#8217;mon Ali, I know you can spend a little more time before  <br />
getting us involved. :)</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71383</guid>
					<title><![CDATA[Re: javascript filetype &#8220;fold&#8221;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71383</link>
					<pubDate>Fri, 24 Feb 2006 01:05:51 +0000</pubDate>
					<dc:creator>batchku</dc:creator>

					<description>
						<![CDATA[
						<p>
i understand.  thanks.</p>
<p>a small followup question,<br />
if i pass an object (of class File or a Folder, i.e. created with &#8220;new File() or new Folder()&#8221;) to a function, how can i test in that function to see if the passed object is a File or a Folder?</p>
<p>a</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71384</guid>
					<title><![CDATA[Re: javascript filetype &#8220;fold&#8221;]]></title>
					<link>http://cycling74.com/forums/topic/javascript-filetype-fold/#post-71384</link>
					<pubDate>Fri, 24 Feb 2006 01:15:09 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Feb 23, 2006, at 5:05 PM, Ali Momeni wrote:</p>
<p>> a small followup question,<br />
> if i pass an object (of class File or a Folder, i.e. created with  <br />
> &#8220;new File() or new Folder()&#8221;) to a function, how can i test in that  <br />
> function to see if the passed object is a File or a Folder?</p>
<p>Check out the object.isPrototypeOf() method:</p>
<p><a href="http://developer.mozilla.org/en/docs/" rel="nofollow">http://developer.mozilla.org/en/docs/</a> <br />
 Core_JavaScript_1.5_Reference:Global_Objects:Object:isProtot ypeOf</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

