<?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: lstat and case-sensitivity in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844345#M37578</link>
    <description>&lt;P&gt;Two different files, differing only by case? &amp;nbsp; Okay. &amp;nbsp; Not something I'd recommend., but enable the DECC$EFS_CASE_PRESERVE feature, if you really want to do that. &amp;nbsp; &lt;A href="http://h71000.www7.hp.com/doc/83final/5763/5763pro_004.html" target="_blank"&gt;Details are in the docs&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2016 21:27:07 GMT</pubDate>
    <dc:creator>Hoff</dc:creator>
    <dc:date>2016-03-22T21:27:07Z</dc:date>
    <item>
      <title>lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844327#M37577</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;I have set "&lt;STRONG&gt;SET PROCESS=&lt;/STRONG&gt;/&lt;STRONG&gt;PARSE_STYLE=EXTENDED" and "SET PROCESS/CASE_LOOKUP=&lt;SPAN&gt;SENSITIVE".&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;By doing so, I can now I have file names with two diffenent cases, e.g. FILE.TXT;1 and file.txt;1 under a directory DIR&lt;/P&gt;&lt;P&gt;when I use lstat([DIR]FILE.TXT) it works, but when I use lstat([DIR]file.txt) it fails with ENOENT. I can do sys$open() on both paths successfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried setting&amp;nbsp;&lt;STRONG&gt;sys$set_process_propertiesw (0, 0, PPROP$C_PARSE_STYLE_TEMP, PARSE_STYLE$C_EXTENDED, 0, 0, 0)&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;sys$set_process_propertiesw (0, 0, PPROP$C_CASE_LOOKUP_TEMP, PPROP$K_CASE_SENSITIVE, 0, 0, 0)&amp;nbsp;&lt;/STRONG&gt;but lstat() still fails.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question -&lt;/P&gt;&lt;P&gt;do these above set_process_propertiesw work for lstat()?&amp;nbsp;&lt;/P&gt;&lt;P&gt;what else should be done so that lstat() treats filenames as case-sensistive?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 20:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844327#M37577</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-22T20:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844345#M37578</link>
      <description>&lt;P&gt;Two different files, differing only by case? &amp;nbsp; Okay. &amp;nbsp; Not something I'd recommend., but enable the DECC$EFS_CASE_PRESERVE feature, if you really want to do that. &amp;nbsp; &lt;A href="http://h71000.www7.hp.com/doc/83final/5763/5763pro_004.html" target="_blank"&gt;Details are in the docs&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 21:27:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844345#M37578</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2016-03-22T21:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844401#M37579</link>
      <description>&lt;P&gt;&amp;gt; do these above set_process_propertiesw work for lstat()?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Apparently not. As "HELP SET PROCESS /PARSE_STYLE" says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Setting a particular parse style tells DCL how it should handle&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command syntax. User programs can also examine the state of this&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setting if they need to use different parse rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; lstat() behavior is a CRTL question, not a DCL question, so it's the&lt;BR /&gt;DECC$ stuff which affects it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 04:19:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844401#M37579</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2016-03-23T04:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844978#M37580</link>
      <description>&lt;P&gt;I have tried this.&lt;/P&gt;&lt;P&gt;under my test directory&amp;nbsp;both OUT.TXT;2 and out.txt;2 exist however only one out.txt;4 exist.&lt;/P&gt;&lt;P&gt;this is my test program.&lt;/P&gt;&lt;P&gt;#define ENABLE TRUE&lt;BR /&gt;#define DISABLE 0&lt;/P&gt;&lt;P&gt;static int set_feature_default(const char *name, int value)&lt;BR /&gt;{&lt;BR /&gt;int index = decc$feature_get_index(name);;&lt;BR /&gt;if (index &amp;gt; 0)&lt;BR /&gt;index = decc$feature_set_value (index, 0, value);&lt;BR /&gt;return index;&lt;BR /&gt;}&lt;BR /&gt;static void show_feature_default(const char* name)&lt;BR /&gt;{&lt;BR /&gt;int index = decc$feature_get_index(name);&lt;BR /&gt;if(index &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;int value = decc$feature_get_value(index, 0);&lt;BR /&gt;cout &amp;lt;&amp;lt; name &amp;lt;&amp;lt; " has value " &amp;lt;&amp;lt; value &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int&lt;BR /&gt;main(int argc, char** argv)&lt;BR /&gt;{&lt;BR /&gt;string sFilePath;&lt;BR /&gt;cout &amp;lt;&amp;lt; "Enter Path: ";&lt;BR /&gt;cin &amp;gt;&amp;gt; sFilePath;&lt;BR /&gt;struct stat st;&lt;BR /&gt;int iRet(0);&lt;/P&gt;&lt;P&gt;int iCaseSensitive(0);&lt;BR /&gt;cout &amp;lt;&amp;lt; "Case Sensitive (1/0): ";&lt;BR /&gt;cin &amp;gt;&amp;gt; iCaseSensitive;&lt;BR /&gt;if(iCaseSensitive)&lt;BR /&gt;{&lt;BR /&gt;int prev_value = set_feature_default("DECC$ARGV_PARSE_STYLE", ENABLE);&lt;BR /&gt;if(0 != prev_value)&lt;BR /&gt;cout &amp;lt;&amp;lt; "Failed to set DECC$ARGV_PARSE_STYLE," &amp;lt;&amp;lt; " errno=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;prev_value = set_feature_default("DECC$EFS_CASE_PRESERVE", ENABLE);&lt;BR /&gt;if(0 != prev_value)&lt;BR /&gt;cout &amp;lt;&amp;lt; "Failed to set DECC$EFS_CASE_PRESERVE," &amp;lt;&amp;lt; " errno=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;show_feature_default("DECC$ARGV_PARSE_STYLE");&lt;BR /&gt;show_feature_default("DECC$EFS_CASE_PRESERVE");&lt;BR /&gt;//decc$feature_show_all();&lt;/P&gt;&lt;P&gt;if((iRet = lstat(sFilePath.c_str(), &amp;amp;st)) &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;cout &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") failed, error=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;cout &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") OK" &amp;lt;&amp;lt; endl;&lt;BR /&gt;exit(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run this on OUT.TXT;2 or out.txt;2, it does not matter what case-sensitivity is set to, lstat works.&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;2&lt;BR /&gt;Case Sensitive (1/0): 1&amp;nbsp;&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value&lt;STRONG&gt; 1&lt;/STRONG&gt;&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;BR /&gt;lstat(dka0:[ssq]out.txt;2) &lt;STRONG&gt;OK&lt;/STRONG&gt;&lt;BR /&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]OUT.TXT;2&lt;BR /&gt;Case Sensitive (1/0): 1&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;BR /&gt;lstat(dka0:[ssq]OUT.TXT;2) &lt;STRONG&gt;OK&lt;/STRONG&gt;&lt;BR /&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;2&lt;BR /&gt;Case Sensitive (1/0): 0&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value &lt;STRONG&gt;0&lt;/STRONG&gt;&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value &lt;STRONG&gt;0&lt;/STRONG&gt;&lt;BR /&gt;lstat(dka0:[ssq]out.txt;2) &lt;STRONG&gt;OK&lt;/STRONG&gt;&lt;BR /&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]OUT.TXT;2&lt;BR /&gt;Case Sensitive (1/0): 0&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value &lt;STRONG&gt;0&lt;/STRONG&gt;&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value &lt;STRONG&gt;0&lt;/STRONG&gt;&lt;BR /&gt;lstat(dka0:[ssq]OUT.TXT;2) &lt;STRONG&gt;OK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I run this with out.txt;3, it does not matter what settings I have for case-sensitive, it always fails with ENOENT&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;4&lt;BR /&gt;Case Sensitive (1/0): 1&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value 1&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 1&lt;BR /&gt;lstat(dka0:[ssq]out.txt;4) failed, error=no such file or directory&lt;BR /&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;4&lt;BR /&gt;Case Sensitive (1/0): 0&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value 0&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 0&lt;BR /&gt;lstat(dka0:[ssq]out.txt;4) failed, error=no such file or directory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing somethign wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 15:01:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6844978#M37580</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-24T15:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845056#M37581</link>
      <description>&lt;P&gt;&amp;gt; main(int argc, char** argv)&lt;BR /&gt;&amp;gt; {&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&amp;gt; int prev_value = set_feature_default("DECC$ARGV_PARSE_STYLE", ENABLE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Too late.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://h71000.www7.hp.com/doc/83final/5763/5763pro_004.html" target="_blank"&gt;http://h71000.www7.hp.com/doc/83final/5763/5763pro_004.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;[...]&lt;BR /&gt;DECC$ARGV_PARSE_STYLE&lt;BR /&gt;With DECC$ARGV_PARSE_STYLE enabled, case is preserved in command-line&lt;BR /&gt;arguments when the process has been set up for extended DCL parsing&lt;BR /&gt;using SET PROCESS/PARSE_STYLE=EXTENDED.&lt;/P&gt;&lt;P&gt;DECC$ARGV_PARSE_STYLE must be defined externally as a logical name or&lt;BR /&gt;set in a function called using the LIB$INITIALIZE mechanism because it&lt;BR /&gt;is evaluated before function main is called.&lt;BR /&gt;[...]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; But I don't see you doing anything with argv[], so this may only&lt;BR /&gt;waste time (and brain-space) without affecting the result.&lt;/P&gt;&lt;P&gt;&amp;gt; under my test directory both OUT.TXT;2 and out.txt;2 exist however&lt;BR /&gt;&amp;gt; only one out.txt;4 exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I would trust actual DIRECTORY output more than your description of&lt;BR /&gt;DIRECTORY output, especially when I see things like the following:&lt;/P&gt;&lt;P&gt;&amp;gt; but when I run this with out.txt;3, it does not matter what settings I&lt;BR /&gt;&amp;gt; have for case-sensitive, it always fails with ENOENT&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; $ test_stat&lt;BR /&gt;&amp;gt; Enter Path: dka0:[ssq]out.txt;4&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845056#M37581</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2016-03-24T18:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845072#M37582</link>
      <description>&lt;P&gt;If this code is ever going to be transferred off of this OpenVMS server and used on other and end-user servers, then this full-on case-sensitivity approach is a &lt;EM&gt;really bad idea&lt;/EM&gt;, and this almost certainly will cause problems and problem reports. &amp;nbsp; That even once this code is working. &amp;nbsp; Very few OpenVMS systems have case sensitivity enabled, and most OpenVMS software does not expect this and has not been tested with this. &amp;nbsp; &amp;nbsp;Officially and per the HPE folks: "HP strongly recommends that you use caution when enabling case&amp;nbsp;sensitivity in your processes."&lt;/P&gt;&lt;P&gt;As for your question, this is typically a UNIX-oriented configuration, so you'll likely want to avoid version support. &amp;nbsp; Quite possibly also OpenVMS filename processing, and use UNIX naming. Or set the UNIX compatibility level to a much higher value. &amp;nbsp; That UNIX level controls the settings of a group of features. &amp;nbsp;More than a little of this is experimentation, based on your local requirements and expectations, and the particular character set in use for the filenames.&lt;/P&gt;&lt;P&gt;That you're possibly working with symbolic links (as lstat expressly supports) also likely means a trip through the related OpenVMS documentation and recent patches, as there are some wrinkles in this area — there was link support added into the last OpenVMS version or two, and it's potentially going to be a little different setup than what might be expected by a UNIX or Linux or BSD developer.&lt;/P&gt;&lt;P&gt;That posted C++ code appears&amp;nbsp;incomplete, too. &amp;nbsp; 23 errors result from a direct compilation. &amp;nbsp; I also can't tell which files are present in your test configuration. &amp;nbsp; &amp;nbsp;If you want us to look at the C++ code, please attach the complete C++ code and the associated build procedure; enough details that I might reproduce this, and test it here. &amp;nbsp;&amp;nbsp;I didn't bother troubleshooting that C++ code, and wrote a simpler C reproducer with rather fewer knobs.&lt;/P&gt;&lt;P&gt;I'm testing with a somewhat shorter example, get what I expect to see with case sensitivity enabled. &amp;nbsp;(But I don't yet know what files exist in your configuration.)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;#include &amp;lt;stat.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include&amp;nbsp; &amp;lt;string.h&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int&lt;/P&gt;&lt;P&gt;main(int argc, char** argv) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct stat statbuf;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int RetStat;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ( argc != 2 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; return EXIT_FAILURE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RetStat = lstat( argv[1], &amp;amp;statbuf );&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ( RetStat )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; strerror( RetStat );&lt;/P&gt;&lt;P&gt;&amp;nbsp; return EXIT_SUCCESS; &amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And things seem to work as expected with a couple of test files on a scratch LD disk set for ODS-5.&lt;/P&gt;&lt;P&gt;Rough sequence used follows...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ld create filespec/size=8192&lt;/P&gt;&lt;P&gt;ld connect filespec LDA256&lt;/P&gt;&lt;P&gt;init LDA256: scratch/STRUCT=5&lt;/P&gt;&lt;P&gt;mount LDA256: scratch&lt;/P&gt;&lt;P&gt;DEFINE DECC$EFS_CASE_PRESERVE TRUE&lt;/P&gt;&lt;P&gt;CC X/DEBUG/NOOPT&lt;/P&gt;&lt;P&gt;LINK X/DEBUG/NOOPT&lt;/P&gt;&lt;P&gt;set process/parse=extended/case=sens&lt;/P&gt;&lt;P&gt;create LDA256:[000000]TEST.TMP&lt;/P&gt;&lt;P&gt;create LDA256:[000000]test.tmp&lt;/P&gt;&lt;P&gt;X&amp;nbsp;LDA256:[000000]TEST.TMP&lt;/P&gt;&lt;P&gt;X&amp;nbsp;LDA256:[000000]test.tmp&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as mentioned above, please attach&amp;nbsp;full source code and enough that somebody here can reproduce the reported behavior.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:46:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845072#M37582</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2016-03-24T18:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845095#M37583</link>
      <description>&lt;P&gt;the only piece that was missing from the code was header, here are they.&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string&amp;gt;&lt;BR /&gt;#include &amp;lt;time.h&amp;gt;&lt;BR /&gt;#include &amp;lt;errno.h&amp;gt;&lt;BR /&gt;#include &amp;lt;unixlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;// VMS Headers&lt;BR /&gt;#include &amp;lt;atrdef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;descrip.h&amp;gt;&lt;BR /&gt;//#include "fatdef.h"&lt;BR /&gt;#include &amp;lt;rms&amp;gt;&lt;BR /&gt;#include &amp;lt;starlet&amp;gt;&lt;BR /&gt;#include &amp;lt;ssdef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;descrip.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fabdef.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;descrip.h&amp;gt;&lt;BR /&gt;#include &amp;lt;atrdef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;ppropdef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fibdef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;iodef.h&amp;gt;&lt;BR /&gt;#include &amp;lt;sbkdef.h&amp;gt;&lt;BR /&gt;//#include "vmstime.h"&lt;/P&gt;&lt;P&gt;typedef struct fibdef FIB;&lt;BR /&gt;//#include "fatdef.h"&lt;BR /&gt;#include "sys$examples:bapidef.h"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a purely VMS test.&lt;/P&gt;&lt;P&gt;As noted above&amp;nbsp;setting these dec$* looks to be too late, this has a code&amp;nbsp;&lt;A href="http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c." target="_blank"&gt;http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c.&lt;/A&gt; But I cannot link this code it keeps complaing about undefined lib$initialize.&lt;/P&gt;&lt;P&gt;Anyways.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One interesting thing that I saw while doing this is. when I use lstat and print time-stamps, those donot match to what dir /full will print (ctime and mtime/atime are swapped). lstat even reports ctime &amp;lt; mtime, which is weird.&amp;nbsp;&lt;/P&gt;&lt;P&gt;int&lt;BR /&gt;main(int argc, char** argv)&lt;BR /&gt;{&lt;BR /&gt;string sFilePath;&lt;BR /&gt;cout &amp;lt;&amp;lt; "Enter Path: ";&lt;BR /&gt;cin &amp;gt;&amp;gt; sFilePath;&lt;BR /&gt;struct stat st;&lt;/P&gt;&lt;P&gt;int iNewCode(false);&lt;BR /&gt;cout &amp;lt;&amp;lt; "use mystat(1/0): ";&lt;BR /&gt;cin &amp;gt;&amp;gt; iNewCode;&lt;BR /&gt;if(!iNewCode)&lt;BR /&gt;{&lt;BR /&gt;if((iRet = lstat(sFilePath.c_str(), &amp;amp;st)) &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;cout &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") failed, error=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;cout &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") OK" &amp;lt;&amp;lt; endl;&lt;BR /&gt;cout &amp;lt;&amp;lt; "ctime: " &amp;lt;&amp;lt; st.st_ctime &amp;lt;&amp;lt; " mtime: " &amp;lt;&amp;lt; st.st_mtime &amp;lt;&amp;lt; " atime: " &amp;lt;&amp;lt; st.st_atime &amp;lt;&amp;lt; " size: " &amp;lt;&amp;lt; st.st_size &amp;lt;&amp;lt; " mode: " &amp;lt;&amp;lt; st.st_mode &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;my_stat(sFilePath.c_str());&lt;/P&gt;&lt;P&gt;exit(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;2&lt;BR /&gt;DECC$ARGV_PARSE_STYLE has value 0&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 0&lt;BR /&gt;use mystat(1/0): 0&lt;BR /&gt;lstat(dka0:[ssq]out.txt;2) OK&lt;BR /&gt;ctime: &lt;STRONG&gt;1337117482&lt;/STRONG&gt; mtime: &lt;STRONG&gt;1337117572&lt;/STRONG&gt; atime: &lt;STRONG&gt;1337117572&lt;/STRONG&gt; size: 1018 mode: 33256&lt;/P&gt;&lt;P&gt;$ dir /full dka0:[ssq]out.txt;2&lt;/P&gt;&lt;P&gt;Directory DKA0:[SSQ]&lt;/P&gt;&lt;P&gt;OUT.TXT;2 File ID: (19005,4,0)&lt;BR /&gt;Size: 2/32 Owner: [SYSTEM]&lt;BR /&gt;Created: 15-MAY-2012 17:31:22.29&lt;BR /&gt;Revised: 15-MAY-2012 17:32:52.87 (1)&lt;BR /&gt;Expires: 10-MAR-2017 14:07:20.31&lt;BR /&gt;Backup: &amp;lt;No backup recorded&amp;gt;&lt;BR /&gt;Effective: &amp;lt;None specified&amp;gt;&lt;BR /&gt;Recording: &amp;lt;None specified&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;Accessed: 15-MAY-2012 17:31:22.29&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Attributes: 15-MAY-2012 17:32:52.87&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Modified: 15-MAY-2012 17:31:22.29&lt;/STRONG&gt;&lt;BR /&gt;Linkcount: 1&lt;BR /&gt;File organization: Sequential&lt;BR /&gt;Shelved state: Online&lt;BR /&gt;Caching attribute: Writethrough&lt;BR /&gt;File attributes: Allocation: 32, Extend: 0, Global buffer count: 0&lt;BR /&gt;Version limit: 3&lt;BR /&gt;Record format: VFC, 2 byte header, maximum 0 bytes, longest 107 bytes&lt;BR /&gt;Record attributes: Print file carriage control&lt;BR /&gt;RMS attributes: None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection: System:RWED, Owner:RWED, Group:RE, World:&lt;BR /&gt;Access Cntrl List: (IDENTIFIER=[150,*],ACCESS=READ)&lt;BR /&gt;Client attributes: None&lt;/P&gt;&lt;P&gt;Total of 1 file, 2/32 blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;convert above time-stamps (ones from lstat) to EST&lt;/P&gt;&lt;P&gt;to me looks like lstat() has a bug in this regard, or may be I am hallucinating&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 20:16:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845095#M37583</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-24T20:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845096#M37584</link>
      <description>&lt;P&gt;actual directory output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ dir dka0:[ssq]&lt;/P&gt;&lt;P&gt;Directory DKA0:[SSQ]&lt;/P&gt;&lt;P&gt;OUT.SAV;1 out.t;1 OUT.TXT;3 OUT.TXT;2&lt;BR /&gt;OUT.TXT;1 out.txt;4 out.txt;3 out.txt;2&lt;BR /&gt;OUT_ORIG.SAV;1 out_rest.sav;1 OUT_RESTORE.TXT;1 RESTORE.TXT;1&lt;BR /&gt;TESTIDX.ISM;1 This_file^_is_not_OK.txt;1&lt;BR /&gt;This_file^%is_not_OK.txt;1 This_file^+is_not_OK.txt;1&lt;BR /&gt;This_file^.is_OK.txt;1 This_file^=is_not_OK.txt;1&lt;/P&gt;&lt;P&gt;Total of 18 files.&lt;BR /&gt;$&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 20:17:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845096#M37584</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-24T20:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845122#M37585</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; As noted above setting these dec$* looks to be too late, this has a code &lt;A href="http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c." target="_blank"&gt;http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c.&lt;/A&gt; But I cannot link this code it keeps complaing about undefined lib$initialize.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LIB$INITIALIZE&lt;/FONT&gt;&amp;nbsp;is in &lt;FONT face="courier new,courier"&gt;SYS$COMMON:[SYSLIB]STARLET.OLB&lt;/FONT&gt;, which the linker processes by default. You may want to show the full link command and the exact linker message.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 22:43:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845122#M37585</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2016-03-24T22:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845125#M37586</link>
      <description>&lt;P&gt;&amp;gt; As noted above setting these dec$* looks to be too late, this has a&lt;BR /&gt;&amp;gt; code &lt;A href="http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c." target="_blank"&gt;http://antinode.info/ftp/cdrtools/cdrtools-2_01_01a11/libvms/vms_init.c.&lt;/A&gt;&lt;BR /&gt;&amp;gt; But I cannot link this code it keeps complaing about undefined&lt;BR /&gt;&amp;gt; lib$initialize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; That's C code, not C++, and I can't see how you're trying to use it.&lt;BR /&gt;(There's more, similar code in Zip and UnZip, if you're looking for more&lt;BR /&gt;C examples, by the way.&amp;nbsp; But if I did it, it probably looks very&lt;BR /&gt;similar.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; "I cannot" is not a useful problem description. It does not say what&lt;BR /&gt;you did. It does not say what happened when you did it.&amp;nbsp; As usual,&lt;BR /&gt;showing actual commands with their actual output can be more helpful&lt;BR /&gt;than vague descriptions or interpretations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LIB$INITIALIZE is easier to use in C (where I have done it) than in&lt;BR /&gt;C++ (where I haven't done it).&amp;nbsp; But if you do not use argv[], then who&lt;BR /&gt;cares about DECC$ARGV_PARSE_STYLE?&amp;nbsp; (Other such things can be set later,&lt;BR /&gt;so you wouldn't need LIB$INITIALIZE for them, only for&lt;BR /&gt;DECC$ARGV_PARSE_STYLE.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you _were_ using argv[], then the easy way to test&lt;BR /&gt;DECC$ARGV_PARSE_STYLE would be to define the logical name, and forget&lt;BR /&gt;about trying to do it in your program (until you determine that you&lt;BR /&gt;really need to use it).&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 22:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845125#M37586</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2016-03-24T22:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845129#M37587</link>
      <description>&lt;P&gt;&amp;gt; LIB$INITIALIZE is in SYS$COMMON:[SYSLIB]STARLET.OLB, which the linker&lt;BR /&gt;&amp;gt; processes by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Not much use if you're trying to supply your own.&lt;/P&gt;&lt;P&gt;&amp;gt; You may want to show the full link command and the&lt;BR /&gt;&amp;gt; exact linker message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; No argument there.&amp;nbsp; As I recall, C++ tends to use/hijack&lt;BR /&gt;LIB$INITIALIZE for its own purposes, so, to use it with C++, you need to&lt;BR /&gt;create a separate shared image with your own LIB$INITIALIZE, and ask the&lt;BR /&gt;linker to get yours, too.&amp;nbsp; But, as I said, I've never done it.&amp;nbsp; A Forum&lt;BR /&gt;or Web search (for: C++ LIB$INITIALIZE) might find some details.&amp;nbsp; If you&lt;BR /&gt;actually care.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 22:57:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845129#M37587</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2016-03-24T22:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845132#M37588</link>
      <description>&lt;P&gt;..&amp;gt;&amp;gt; LIB$INITIALIZE is in SYS$COMMON:[SYSLIB]STARLET.OLB, which the linker&lt;BR /&gt;&amp;gt;&amp;gt; processes by default.&lt;/P&gt;&lt;P&gt;&amp;gt;Not much use if you're trying to supply your own.&lt;/P&gt;&lt;P&gt;Your own what? The OP said, &amp;nbsp;"undefined lib$initialize". Which may be a real linker message or not. If that undefined symbol is&amp;nbsp;LIB$INITIALIZE, it is defined in&amp;nbsp;SYS$COMMON:[SYSLIB]STARLET.OLB. You can not have your own symbol&amp;nbsp;LIB$INITIALIZE to get the image initialization done. You have to have your own PSECT&amp;nbsp;LIB$INITIALIZE merged into the pre-fabricated wrappers from the object module &amp;nbsp;LIB$INITIALIZE, which is part of&amp;nbsp;STARLET.OLB.&lt;/P&gt;&lt;P&gt;Edit: Actually, you don't need the symbol&amp;nbsp;LIB$INITIALIZE at all. You only need to include the&amp;nbsp;object module LIB$INITIALIZE.&lt;/P&gt;&lt;P&gt;&amp;gt; ...&amp;nbsp;As I recall, C++ tends to use/hijack&lt;BR /&gt;&amp;gt; LIB$INITIALIZE for its own purposes, so, to use it with C++, you need to&lt;BR /&gt;&amp;gt; create a separate shared image with your own LIB$INITIALIZE, and ask the&lt;BR /&gt;&amp;gt; linker to get yours, too. But, as I said, I've never done it. A Forum&lt;BR /&gt;&amp;gt; or Web search (for: C++ LIB$INITIALIZE) might find some details. If you&lt;BR /&gt;&amp;gt; actually care.&lt;/P&gt;&lt;P&gt;I wouldn't say hijack. C++ and its RTL (on I64 if I remember correctly) uses the&amp;nbsp;LIB$INITIALIZE mechanism as well. To get your own image initialization done before the RTL's shareable image ones, you have to have a shareable image with your init code which the image activator activates before the C++ RTL. The image activator followes the list of shareable images as the linker sets it up. That is, your link command has to ensure that your (init code in your) shareable image is "in front of" the C++ RTL's one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 23:47:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845132#M37588</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2016-03-24T23:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845201#M37589</link>
      <description>&lt;P&gt;As others have correctly noted, this utterly non-modular and nonsensical and ill-considered "design" of the C run-time library means either defining the logical names ahead of image invocation, or — if you want to use the API — invoking the feature set calls in the initialization PSECT, ahead of the main() call. &amp;nbsp; (The main() call invokes the C library initialization code, and which is also why you see that "type GO to get to the start of&amp;nbsp;the main program" in the debugger. )&lt;/P&gt;&lt;P&gt;This scheme all makes sense if you know how the OpenVMS image initialization actually works, but pragmaticallt it's a design that's user-hostile and non-modular at best, and some of the alternative user interfaces possible here could have made this vastly easiler and better.&lt;/P&gt;&lt;P&gt;(If you've inferred that I might not be a proponent of this "design", you probably don't know the half of what I think about this particular and fetid heap of vomitus. &amp;nbsp;This was a Bad Idea when it was built, and the imbroglio has only increased as settings accreted. &amp;nbsp;But I digress.)&lt;/P&gt;&lt;P&gt;When logging bug reports, posting full details and a reproducer really helps — saves folks from guessing what has happened — and it requires less effort on the part of those that might help you to get to the answer that you want and need. &amp;nbsp; Attaching a zip here can work nicely too, as that can contain the entirety of the reproducer.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 13:28:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845201#M37589</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2016-03-25T13:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845446#M37590</link>
      <description>&lt;P&gt;OK. First I would like to point out what behavior I see with lstat (this is simple nothing do with case-sensitivity, something I just stumbled upon).&lt;/P&gt;&lt;P&gt;this is cpp program using lstat() and printing ctime, atime, mtime.&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string&amp;gt;&lt;BR /&gt;#include &amp;lt;time.h&amp;gt;&lt;BR /&gt;#include &amp;lt;errno.h&amp;gt;&lt;BR /&gt;#include &amp;lt;unixlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;using namespace std;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char** argv)&lt;BR /&gt;{&lt;BR /&gt;string sFilePath;&lt;BR /&gt;cout &amp;lt;&amp;lt; "Enter Path: ";&lt;BR /&gt;cin &amp;gt;&amp;gt; sFilePath;&lt;BR /&gt;struct stat st;&lt;BR /&gt;int iRet(0);&lt;/P&gt;&lt;P&gt;if((iRet = lstat(sFilePath.c_str(), &amp;amp;st)) &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;cerr &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") failed, error=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;exit(-1);&lt;BR /&gt;}&lt;BR /&gt;cout &amp;lt;&amp;lt; "ctime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_ctime));&lt;BR /&gt;cout &amp;lt;&amp;lt; "mtime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_mtime));&lt;BR /&gt;cout &amp;lt;&amp;lt; "atime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_atime));&lt;BR /&gt;exit(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;this is the result using this program.&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;2&lt;BR /&gt;ctime: Tue May 15 17:31:22 2012&lt;BR /&gt;mtime: Tue May 15 17:32:52 2012&lt;BR /&gt;atime: Tue May 15 17:32:52 2012&lt;/P&gt;&lt;P&gt;and this is dir /full result on the same file&lt;/P&gt;&lt;P&gt;$ dir /full dka0:[ssq]out.txt;2&lt;/P&gt;&lt;P&gt;Directory DKA0:[SSQ]&lt;/P&gt;&lt;P&gt;OUT.TXT;2 File ID: (19005,4,0)&lt;BR /&gt;Size: 2/32 Owner: [SYSTEM]&lt;BR /&gt;Created: 15-MAY-2012 17:31:22.29&lt;BR /&gt;Revised: 15-MAY-2012 17:32:52.87 (1)&lt;BR /&gt;Expires: 10-MAR-2017 14:07:20.31&lt;BR /&gt;Backup: &amp;lt;No backup recorded&amp;gt;&lt;BR /&gt;Effective: &amp;lt;None specified&amp;gt;&lt;BR /&gt;Recording: &amp;lt;None specified&amp;gt;&lt;BR /&gt;Accessed: 15-MAY-2012 17:31:22.29&lt;BR /&gt;Attributes: 15-MAY-2012 17:32:52.87&lt;BR /&gt;Modified: 15-MAY-2012 17:31:22.29&lt;BR /&gt;Linkcount: 1&lt;BR /&gt;File organization: Sequential&lt;BR /&gt;Shelved state: Online&lt;BR /&gt;Caching attribute: Writethrough&lt;BR /&gt;File attributes: Allocation: 32, Extend: 0, Global buffer count: 0&lt;BR /&gt;Version limit: 3&lt;BR /&gt;Record format: VFC, 2 byte header, maximum 0 bytes, longest 107 bytes&lt;BR /&gt;Record attributes: Print file carriage control&lt;BR /&gt;RMS attributes: None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection: System:RWED, Owner:RWED, Group:RE, World:&lt;BR /&gt;Access Cntrl List: (IDENTIFIER=[150,*],ACCESS=READ)&lt;BR /&gt;Client attributes: None&lt;/P&gt;&lt;P&gt;Total of 1 file, 2/32 blocks.&lt;BR /&gt;$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so this is the lstat() bug that I talked about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second. I dont really need DEC$ARGV_PARSE_STYLE but I need DEC$EFS_CASE_PRESERVE instead,&lt;STRONG&gt; I think&lt;/STRONG&gt;, to instruct&amp;nbsp;lstat() to treat filename case-sensitively.&lt;/P&gt;&lt;P&gt;So this is the&amp;nbsp;lstat() program (same above program silghtly changed) for case-sensitivity test.&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string&amp;gt;&lt;BR /&gt;#include &amp;lt;time.h&amp;gt;&lt;BR /&gt;#include &amp;lt;errno.h&amp;gt;&lt;BR /&gt;#include &amp;lt;unixlib.h&amp;gt;&lt;/P&gt;&lt;P&gt;using namespace std;&lt;/P&gt;&lt;P&gt;#define ENABLE TRUE&lt;BR /&gt;#define DISABLE 0&lt;/P&gt;&lt;P&gt;static int set_feature_default(const char *name, int value)&lt;BR /&gt;{&lt;BR /&gt;int index = decc$feature_get_index(name);;&lt;BR /&gt;if (index &amp;gt; 0)&lt;BR /&gt;index = decc$feature_set_value (index, 0, value);&lt;BR /&gt;return index;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void show_feature_default(const char* name)&lt;BR /&gt;{&lt;BR /&gt;int index = decc$feature_get_index(name);&lt;BR /&gt;if(index &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;int value = decc$feature_get_value(index, 0);&lt;BR /&gt;cout &amp;lt;&amp;lt; name &amp;lt;&amp;lt; " has value " &amp;lt;&amp;lt; value &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char** argv)&lt;BR /&gt;{&lt;BR /&gt;string sFilePath;&lt;BR /&gt;cout &amp;lt;&amp;lt; "Enter Path: ";&lt;BR /&gt;cin &amp;gt;&amp;gt; sFilePath;&lt;BR /&gt;int iCaseSensitive(0);&lt;BR /&gt;int prev_value = set_feature_default("DECC$EFS_CASE_PRESERVE", ENABLE);&lt;BR /&gt;if(0 != prev_value)&lt;BR /&gt;cerr &amp;lt;&amp;lt; "Failed to set DECC$EFS_CASE_PRESERVE," &amp;lt;&amp;lt; " errno=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;show_feature_default("DECC$EFS_CASE_PRESERVE");&lt;BR /&gt;struct stat st;&lt;BR /&gt;int iRet(0);&lt;/P&gt;&lt;P&gt;if((iRet = lstat(sFilePath.c_str(), &amp;amp;st)) &amp;lt; 0)&lt;BR /&gt;{&lt;BR /&gt;cerr &amp;lt;&amp;lt; "lstat(" &amp;lt;&amp;lt; sFilePath &amp;lt;&amp;lt; ") failed, error=" &amp;lt;&amp;lt; strerror(errno) &amp;lt;&amp;lt; endl;&lt;BR /&gt;exit(-1);&lt;BR /&gt;}&lt;BR /&gt;cout &amp;lt;&amp;lt; "ctime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_ctime));&lt;BR /&gt;cout &amp;lt;&amp;lt; "mtime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_mtime));&lt;BR /&gt;cout &amp;lt;&amp;lt; "atime: " &amp;lt;&amp;lt; asctime(localtime(&amp;amp;st.st_atime));&lt;BR /&gt;exit(0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;dir listing on the directory.&lt;/P&gt;&lt;P&gt;$ dir dka0:[ssq]&lt;/P&gt;&lt;P&gt;Directory DKA0:[SSQ]&lt;/P&gt;&lt;P&gt;OUT.SAV;1 out.t;1 OUT.TXT;3 OUT.TXT;2&lt;BR /&gt;OUT.TXT;1 out.txt;4 out.txt;3 out.txt;2&lt;BR /&gt;OUT_ORIG.SAV;1 out_rest.sav;1 OUT_RESTORE.TXT;1 RESTORE.TXT;1&lt;BR /&gt;TESTIDX.ISM;1 This_file^_is_not_OK.txt;1&lt;BR /&gt;This_file^%is_not_OK.txt;1 This_file^+is_not_OK.txt;1&lt;BR /&gt;This_file^.is_OK.txt;1 This_file^=is_not_OK.txt;1&lt;/P&gt;&lt;P&gt;Total of 18 files.&lt;BR /&gt;$&lt;/P&gt;&lt;P&gt;note above, only out.txt;4 exits but both out.txt;2 and OUT.TXT;2 exist. Now trying this program&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;4&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 1&lt;BR /&gt;lstat(dka0:[ssq]out.txt;4) failed, error=no such file or directory&lt;BR /&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]out.txt;2&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 1&lt;BR /&gt;ctime: Tue May 15 17:31:22 2012&lt;BR /&gt;mtime: Tue May 15 17:32:52 2012&lt;BR /&gt;atime: Tue May 15 17:32:52 2012&lt;/P&gt;&lt;P&gt;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]OUT.TXT;2&lt;BR /&gt;DECC$EFS_CASE_PRESERVE has value 1&lt;BR /&gt;ctime: Tue May 15 17:31:22 2012&lt;BR /&gt;mtime: Tue May 15 17:32:52 2012&lt;BR /&gt;atime: Tue May 15 17:32:52 2012&lt;BR /&gt;$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note that these are on &lt;STRONG&gt;IA64&lt;/STRONG&gt;, we dont have Alpha or VAX.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rationale on why I am doing this - In my program (the real bigger one), I have a vital place where I need to do a lstat() on a file to grab some attributes (I am primarily a UNIX programmer making some code transition to OpenVMS, hence UNIX C-api come handy to me always). This is where it came to my notice that lstat() always fails when the volume has case-sensitivity enabled and there is a file with lower case only. Also, to note, that a subsequent sys$open() on the same full actually works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2016 19:50:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845446#M37590</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-27T19:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845447#M37591</link>
      <description>&lt;P&gt;this is the full link command&lt;/P&gt;&lt;P&gt;$ CXXLINK/exe=test_stat.exe test_stat.obj,SYS$SHARE:STARLET.OLB&lt;BR /&gt;&lt;STRONG&gt;%ILINK-E-INVLDHDR, invalid ELF header; field 'ehdr$b_ei_mag0' has invalid value %X09&lt;/STRONG&gt;&lt;BR /&gt;module: &amp;lt;unassigned&amp;gt;&lt;BR /&gt;file: SYS$COMMON:[SYSLIB]STARLET.OLB;1&lt;BR /&gt;%ILINK-W-NUDFSYMS, 1 undefined symbol:&lt;BR /&gt;%ILINK-I-UDFSYM, int lib$initialize()&lt;BR /&gt;%ILINK-W-USEUNDEF, undefined symbol int lib$initialize() referenced&lt;BR /&gt;source code name: "lib$initialize()"&lt;BR /&gt;section: .sdata&lt;BR /&gt;offset: %X0000000000000010&lt;BR /&gt;module: TEST_STAT&lt;BR /&gt;file: DNFS1:[cxunix.source.CommClient.ClProxyConnAPI.Client.backup]TEST_STAT.OBJ;32&lt;/P&gt;&lt;P&gt;the highlighted line is what I am curious about.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2016 19:56:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845447#M37591</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-27T19:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and case-sensitivity</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845451#M37592</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;$ CXXLINK/exe=test_stat.exe test_stat.obj,SYS$SHARE:STARLET.OLB&lt;/P&gt;&lt;P&gt;&amp;gt; %ILINK-E-INVLDHDR, invalid ELF header; field 'ehdr$b_ei_mag0' has invalid value %X09&lt;/P&gt;&lt;P&gt;Without any qualifier, the linker expects object files as arguments. STARLET.OLB is an object library. If you want to resolve from a library, you need&amp;nbsp;to add the /LIBRARY qualifier to the object library. However, as already mentioned, this object library is already processed, by default. You may end up with "%ILINK-W-MULDEF" warning messages.&lt;/P&gt;&lt;P&gt;On the other hand, you are using CXXLINK, which does some postprocessing on the VMS linker output: something like "%ILINK-I-UDFSYM, LIB$INITIALIZE__XV" is converted to "%ILINK-I-UDFSYM, int lib$initialize()" - these examples are taken from Alpha, so the mangled name on I64 may be slightly different.. The linker resolves mangled names, CXXLINK hides these names and shows the demangled names. Essentially you have an unresolved symbol like "LIB$INITIALIZE__XV", which is not defined in any object module in&amp;nbsp;STARLET.OLB, as the wanted, real name in that library and its module is "LIB$INITIALIZE." In other words, you need to wrap the "extern int&amp;nbsp;lib$initialize();" with `extern "C" { &amp;nbsp;... &amp;nbsp;}.'&lt;/P&gt;&lt;P&gt;For many VMS programmers, referencing the symbol LIB$INITIALIZE is just more convenient - as STARLET.OLB is searched by default for that symbol, than explicitly including the needed object module with a linker command string like "SYS$SHARE:STARLET/LIB/INCL=LIB$INITIALIZE".&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2016 21:23:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-case-sensitivity/m-p/6845451#M37592</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2016-03-27T21:23:03Z</dc:date>
    </item>
  </channel>
</rss>

