<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to use directory functions in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877019#M9662</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/453708"&gt;Otto Wesso&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;i'm trying do build my own application with the IPP and now i need to access a directory. Sadly the documentation of the IPP brings no help. Can somebody give me a sample how to use the vm_dir_open() and the vm_dir_read() functions please?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards,&lt;BR /&gt;Otto&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi Otto,&lt;BR /&gt;The vm_dir_open() and vm_dir_read() functions are Unix style directory functions as described in the ums_manual.pdf file, table 5.10 : "&lt;BR /&gt;Directory traverse functions Have VM unique names and serve as wrappers for the specific directory traverse functions&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; Ipp32s vm_dir_open(vm_dir **dd, vm_char*path); Similar to Unix opendir&lt;BR /&gt; Ipp32s vm_dir_read(vm_dir *dd, vm_char *filename, int nchars); Similar to Unix readdir &lt;/EM&gt;&lt;/SPAN&gt;".&lt;BR /&gt;Look at this as an a piece of sample with VM directory functions. The vm_dir_open() and vm_dir_read() functions are bold faced.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;EM&gt;#if !defined(LINUX32) &amp;amp;&amp;amp; !defined(OSX)&lt;BR /&gt;# include &lt;CSTDIO&gt;&lt;BR /&gt;# include &lt;IOSTREAM&gt;&lt;BR /&gt;# if _MSC_VER &amp;gt;= 1400&lt;BR /&gt;# pragma warning(disable: 4996)&lt;BR /&gt;# endif&lt;BR /&gt;# define TFDNAME VM_STRING("TEST\tstfile.")&lt;BR /&gt;# define TFDIRFULL VM_STRING("TEST2\*.*")&lt;BR /&gt;#else&lt;BR /&gt;# define TFDNAME "TEST/tstfile."&lt;BR /&gt;# define TFDIRFULL VM_STRING("TEST2")&lt;BR /&gt;#endif // if !defined(LINUX32) &amp;amp;&amp;amp; !defined(OSX)&lt;BR /&gt;#define MESSAGE_OK {cout &amp;lt;&amp;lt; VM_STRING("....... OK") &amp;lt;&amp;lt; endl; }&lt;BR /&gt;#define MESSAGE_FAIL {cout &amp;lt;&amp;lt; VM_STRING("....... FAIL") &amp;lt;&amp;lt; endl;}&lt;BR /&gt;#define TFDIR VM_STRING("TEST")&lt;BR /&gt;#define TFDFILES 5&lt;BR /&gt;#define FAIL_BREAK {cout &amp;lt;&amp;lt; VM_STRING("....... FAIL") &amp;lt;&amp;lt; endl; break; }&lt;BR /&gt;#define SMALLSTRING 2048&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt; vm_dir *tsd;&lt;BR /&gt; vm_char s[SMALLSTRING];&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("directory read/delete operations") &amp;lt;&amp;lt; endl;&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("create directory TEST and 5 files in it") &amp;lt;&amp;lt; endl;&lt;BR /&gt; vm_char tfdname[32];&lt;BR /&gt; Ipp32u i;&lt;BR /&gt; do {&lt;BR /&gt; if (!vm_dir_mkdir(TFDIR)) FAIL_BREAK&lt;BR /&gt; for (i = 0; i &amp;lt; TFDFILES; ++i) {&lt;BR /&gt; vm_string_sprintf( tfdname, VM_STRING("%s%01d"), TFDNAME, i);&lt;BR /&gt; if (((tst = vm_file_fopen(tfdname, VM_STRING("w"))) != NULL) &amp;amp;&amp;amp;&lt;BR /&gt; (vm_file_fwrite((void *)tfdname, 1, (Ipp32s)vm_string_strlen(tfdname), tst) == (Ipp32s)vm_string_strlen(tfdname)))&lt;BR /&gt; vm_file_fclose(tst);&lt;BR /&gt; }&lt;BR /&gt; if (i &amp;lt; TFDFILES) FAIL_BREAK&lt;BR /&gt; /* read directory */&lt;BR /&gt; vm_string_sprintf(tfdname, VM_STRING("%s*"),TFDNAME);&lt;BR /&gt; Ipp32u j = 0;&lt;BR /&gt; // try to remove test directory&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("check TEST directory contentsn");&lt;BR /&gt; if (&lt;STRONG&gt;vm_dir_open(&amp;amp;tsd, TFDIRFULL)&lt;/STRONG&gt;) {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("directory opened OKn");&lt;BR /&gt; while (&lt;STRONG&gt;vm_dir_read(tsd, s, SMALLSTRING)&lt;/STRONG&gt;) {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("entry in : ") &amp;lt;&amp;lt; s &amp;lt;&amp;lt; endl;&lt;BR /&gt; ++j;&lt;BR /&gt; }&lt;BR /&gt; vm_dir_close(tsd);&lt;BR /&gt; } else {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("errno = ") &amp;lt;&amp;lt; errno &amp;lt;&amp;lt; endl;&lt;BR /&gt; FAIL_BREAK&lt;BR /&gt; }&lt;BR /&gt; /* remove files and test directory */&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("remove files and test directory") &amp;lt;&amp;lt; endl;&lt;BR /&gt; for (i = 0; i &amp;lt; TFDFILES; ++i) {&lt;BR /&gt; vm_string_sprintf( tfdname, VM_STRING("%s%01d"), TFDNAME, i);&lt;BR /&gt; if (!vm_dir_remove(tfdname))&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; if (i &amp;lt; TFDFILES) FAIL_BREAK;&lt;BR /&gt; if(!vm_dir_remove(TFDIR)) FAIL_BREAK;&lt;BR /&gt; MESSAGE_OK&lt;BR /&gt; } while(0);&lt;BR /&gt;&lt;/IOSTREAM&gt;&lt;/CSTDIO&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Alexander&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 25 Nov 2009 07:14:28 GMT</pubDate>
    <dc:creator>Alexander_Modenov__I</dc:creator>
    <dc:date>2009-11-25T07:14:28Z</dc:date>
    <item>
      <title>how to use directory functions</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877018#M9661</link>
      <description>Hi,&lt;BR /&gt;i'm trying do build my own application with the IPP and now i need to access a directory. Sadly the documentation of the IPP brings no help. Can somebody give me a sample how to use the vm_dir_open() and the vm_dir_read() functions please?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards,&lt;BR /&gt;Otto</description>
      <pubDate>Wed, 25 Nov 2009 06:39:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877018#M9661</guid>
      <dc:creator>Otto_Wesso</dc:creator>
      <dc:date>2009-11-25T06:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to use directory functions</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877019#M9662</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/453708"&gt;Otto Wesso&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;i'm trying do build my own application with the IPP and now i need to access a directory. Sadly the documentation of the IPP brings no help. Can somebody give me a sample how to use the vm_dir_open() and the vm_dir_read() functions please?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards,&lt;BR /&gt;Otto&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi Otto,&lt;BR /&gt;The vm_dir_open() and vm_dir_read() functions are Unix style directory functions as described in the ums_manual.pdf file, table 5.10 : "&lt;BR /&gt;Directory traverse functions Have VM unique names and serve as wrappers for the specific directory traverse functions&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; Ipp32s vm_dir_open(vm_dir **dd, vm_char*path); Similar to Unix opendir&lt;BR /&gt; Ipp32s vm_dir_read(vm_dir *dd, vm_char *filename, int nchars); Similar to Unix readdir &lt;/EM&gt;&lt;/SPAN&gt;".&lt;BR /&gt;Look at this as an a piece of sample with VM directory functions. The vm_dir_open() and vm_dir_read() functions are bold faced.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;EM&gt;#if !defined(LINUX32) &amp;amp;&amp;amp; !defined(OSX)&lt;BR /&gt;# include &lt;CSTDIO&gt;&lt;BR /&gt;# include &lt;IOSTREAM&gt;&lt;BR /&gt;# if _MSC_VER &amp;gt;= 1400&lt;BR /&gt;# pragma warning(disable: 4996)&lt;BR /&gt;# endif&lt;BR /&gt;# define TFDNAME VM_STRING("TEST\tstfile.")&lt;BR /&gt;# define TFDIRFULL VM_STRING("TEST2\*.*")&lt;BR /&gt;#else&lt;BR /&gt;# define TFDNAME "TEST/tstfile."&lt;BR /&gt;# define TFDIRFULL VM_STRING("TEST2")&lt;BR /&gt;#endif // if !defined(LINUX32) &amp;amp;&amp;amp; !defined(OSX)&lt;BR /&gt;#define MESSAGE_OK {cout &amp;lt;&amp;lt; VM_STRING("....... OK") &amp;lt;&amp;lt; endl; }&lt;BR /&gt;#define MESSAGE_FAIL {cout &amp;lt;&amp;lt; VM_STRING("....... FAIL") &amp;lt;&amp;lt; endl;}&lt;BR /&gt;#define TFDIR VM_STRING("TEST")&lt;BR /&gt;#define TFDFILES 5&lt;BR /&gt;#define FAIL_BREAK {cout &amp;lt;&amp;lt; VM_STRING("....... FAIL") &amp;lt;&amp;lt; endl; break; }&lt;BR /&gt;#define SMALLSTRING 2048&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt; vm_dir *tsd;&lt;BR /&gt; vm_char s[SMALLSTRING];&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("directory read/delete operations") &amp;lt;&amp;lt; endl;&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("create directory TEST and 5 files in it") &amp;lt;&amp;lt; endl;&lt;BR /&gt; vm_char tfdname[32];&lt;BR /&gt; Ipp32u i;&lt;BR /&gt; do {&lt;BR /&gt; if (!vm_dir_mkdir(TFDIR)) FAIL_BREAK&lt;BR /&gt; for (i = 0; i &amp;lt; TFDFILES; ++i) {&lt;BR /&gt; vm_string_sprintf( tfdname, VM_STRING("%s%01d"), TFDNAME, i);&lt;BR /&gt; if (((tst = vm_file_fopen(tfdname, VM_STRING("w"))) != NULL) &amp;amp;&amp;amp;&lt;BR /&gt; (vm_file_fwrite((void *)tfdname, 1, (Ipp32s)vm_string_strlen(tfdname), tst) == (Ipp32s)vm_string_strlen(tfdname)))&lt;BR /&gt; vm_file_fclose(tst);&lt;BR /&gt; }&lt;BR /&gt; if (i &amp;lt; TFDFILES) FAIL_BREAK&lt;BR /&gt; /* read directory */&lt;BR /&gt; vm_string_sprintf(tfdname, VM_STRING("%s*"),TFDNAME);&lt;BR /&gt; Ipp32u j = 0;&lt;BR /&gt; // try to remove test directory&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("check TEST directory contentsn");&lt;BR /&gt; if (&lt;STRONG&gt;vm_dir_open(&amp;amp;tsd, TFDIRFULL)&lt;/STRONG&gt;) {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("directory opened OKn");&lt;BR /&gt; while (&lt;STRONG&gt;vm_dir_read(tsd, s, SMALLSTRING)&lt;/STRONG&gt;) {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("entry in : ") &amp;lt;&amp;lt; s &amp;lt;&amp;lt; endl;&lt;BR /&gt; ++j;&lt;BR /&gt; }&lt;BR /&gt; vm_dir_close(tsd);&lt;BR /&gt; } else {&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("errno = ") &amp;lt;&amp;lt; errno &amp;lt;&amp;lt; endl;&lt;BR /&gt; FAIL_BREAK&lt;BR /&gt; }&lt;BR /&gt; /* remove files and test directory */&lt;BR /&gt; cout &amp;lt;&amp;lt; VM_STRING("remove files and test directory") &amp;lt;&amp;lt; endl;&lt;BR /&gt; for (i = 0; i &amp;lt; TFDFILES; ++i) {&lt;BR /&gt; vm_string_sprintf( tfdname, VM_STRING("%s%01d"), TFDNAME, i);&lt;BR /&gt; if (!vm_dir_remove(tfdname))&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; if (i &amp;lt; TFDFILES) FAIL_BREAK;&lt;BR /&gt; if(!vm_dir_remove(TFDIR)) FAIL_BREAK;&lt;BR /&gt; MESSAGE_OK&lt;BR /&gt; } while(0);&lt;BR /&gt;&lt;/IOSTREAM&gt;&lt;/CSTDIO&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Alexander&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 07:14:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877019#M9662</guid>
      <dc:creator>Alexander_Modenov__I</dc:creator>
      <dc:date>2009-11-25T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to use directory functions</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877020#M9663</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
simply nice, now i understand. Thank you!&lt;BR /&gt;&lt;BR /&gt;Otto&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 08:39:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/how-to-use-directory-functions/m-p/877020#M9663</guid>
      <dc:creator>Otto_Wesso</dc:creator>
      <dc:date>2009-11-25T08:39:30Z</dc:date>
    </item>
  </channel>
</rss>

