<?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 file size in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845464#M37594</link>
    <description>&lt;P&gt;this is the FDL&lt;/P&gt;&lt;P&gt;IDENT FDL_VERSION 02 "27-MAR-2016 20:49:02 OpenVMS ANALYZE/RMS_FILE Utility"&lt;/P&gt;&lt;P&gt;SYSTEM&lt;BR /&gt;SOURCE OpenVMS&lt;/P&gt;&lt;P&gt;FILE&lt;BR /&gt;ALLOCATION 33554432&lt;BR /&gt;BEST_TRY_CONTIGUOUS yes&lt;BR /&gt;CLUSTER_SIZE 16&lt;BR /&gt;CONTIGUOUS no&lt;BR /&gt;EXTENSION 0&lt;BR /&gt;FILE_MONITORING no&lt;BR /&gt;NAME "DKA0:[SSQ]PAGEFILE.SYS;1"&lt;BR /&gt;ORGANIZATION sequential&lt;BR /&gt;OWNER [1,1]&lt;BR /&gt;PROTECTION (system:RWED, owner:RWED, group:, world:)&lt;BR /&gt;GLOBAL_BUFFER_COUNT 0&lt;BR /&gt;GLBUFF_CNT_V83 0&lt;BR /&gt;GLBUFF_FLAGS_V83 none&lt;/P&gt;&lt;P&gt;RECORD&lt;BR /&gt;BLOCK_SPAN yes&lt;BR /&gt;CARRIAGE_CONTROL none&lt;BR /&gt;FORMAT undefined&lt;BR /&gt;SIZE 0&lt;BR /&gt;$&lt;/P&gt;</description>
    <pubDate>Mon, 28 Mar 2016 00:52:24 GMT</pubDate>
    <dc:creator>mpradhan</dc:creator>
    <dc:date>2016-03-28T00:52:24Z</dc:date>
    <item>
      <title>lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845463#M37593</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have big&amp;nbsp;file.&lt;/P&gt;&lt;P&gt;$ dir /full dka0:[ssq]PAGEFILE.SYS&lt;/P&gt;&lt;P&gt;Directory DKA0:[SSQ]&lt;/P&gt;&lt;P&gt;PAGEFILE.SYS;1 File ID: (6791,17,0)&lt;BR /&gt;&lt;STRONG&gt;Size: 33554432/33554432&lt;/STRONG&gt; Owner: [1,1]&lt;BR /&gt;Created: 24-MAR-2016 14:58:22.12&lt;BR /&gt;Revised: 24-MAR-2016 15:52:35.58 (2)&lt;BR /&gt;Expires: &amp;lt;None specified&amp;gt;&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: 24-MAR-2016 14:58:22.12&lt;BR /&gt;Attributes: 24-MAR-2016 15:52:35.58&lt;BR /&gt;Modified: 24-MAR-2016 14:58:22.12&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: 33554432, Extend: 0, Global buffer count: 0&lt;BR /&gt;No version limit, Contiguous best try&lt;BR /&gt;Record format: Undefined, maximum 0 bytes, longest 0 bytes&lt;BR /&gt;Record attributes: None&lt;BR /&gt;RMS attributes: None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection: System:RWED, Owner:RWED, Group:, World:&lt;BR /&gt;Access Cntrl List: None&lt;BR /&gt;Client attributes: None&lt;/P&gt;&lt;P&gt;Total of 1 file, 33554432/33554432 blocks.&lt;BR /&gt;$&lt;/P&gt;&lt;P&gt;when I use lstat() to stat this file and get the size, I see zero.&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;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;cout &amp;lt;&amp;lt; "size: " &amp;lt;&amp;lt; st.st_size &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;$ test_stat&lt;BR /&gt;Enter Path: dka0:[ssq]PAGEFILE.SYS&lt;BR /&gt;ctime: Thu Mar 24 14:58:22 2016&lt;BR /&gt;mtime: Thu Mar 24 15:52:35 2016&lt;BR /&gt;atime: Thu Mar 24 15:52:35 2016&lt;BR /&gt;&lt;STRONG&gt;size: 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I think this is a bug in CRTL lstat().&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Volume has CLUSTER_SIZE=16.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any direction is appreciated.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Manoj&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 00:39:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845463#M37593</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-28T00:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845464#M37594</link>
      <description>&lt;P&gt;this is the FDL&lt;/P&gt;&lt;P&gt;IDENT FDL_VERSION 02 "27-MAR-2016 20:49:02 OpenVMS ANALYZE/RMS_FILE Utility"&lt;/P&gt;&lt;P&gt;SYSTEM&lt;BR /&gt;SOURCE OpenVMS&lt;/P&gt;&lt;P&gt;FILE&lt;BR /&gt;ALLOCATION 33554432&lt;BR /&gt;BEST_TRY_CONTIGUOUS yes&lt;BR /&gt;CLUSTER_SIZE 16&lt;BR /&gt;CONTIGUOUS no&lt;BR /&gt;EXTENSION 0&lt;BR /&gt;FILE_MONITORING no&lt;BR /&gt;NAME "DKA0:[SSQ]PAGEFILE.SYS;1"&lt;BR /&gt;ORGANIZATION sequential&lt;BR /&gt;OWNER [1,1]&lt;BR /&gt;PROTECTION (system:RWED, owner:RWED, group:, world:)&lt;BR /&gt;GLOBAL_BUFFER_COUNT 0&lt;BR /&gt;GLBUFF_CNT_V83 0&lt;BR /&gt;GLBUFF_FLAGS_V83 none&lt;/P&gt;&lt;P&gt;RECORD&lt;BR /&gt;BLOCK_SPAN yes&lt;BR /&gt;CARRIAGE_CONTROL none&lt;BR /&gt;FORMAT undefined&lt;BR /&gt;SIZE 0&lt;BR /&gt;$&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 00:52:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845464#M37594</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-28T00:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845486#M37595</link>
      <description>&lt;P&gt;&amp;nbsp;&amp;nbsp; My C++ expertise is approximately nil, but...&lt;/P&gt;&lt;P&gt;&amp;gt; size: 0&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; I think this is a bug in CRTL lstat().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I'd bet against that.&lt;/P&gt;&lt;P&gt;&amp;gt; Size: 33554432/33554432 Owner: [1,1]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Let's see that in bytes:&lt;/P&gt;&lt;P&gt;ALP $ write sys$output 33554432 * 512&lt;BR /&gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Look familiar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Of course, with my weak psychic powers, I can't see how you compiled&lt;BR /&gt;your program, but I'd be willing to guess that /DEFINE = _LARGEFILE was&lt;BR /&gt;not part of the command.&amp;nbsp; Around here, for example, with a smaller file:&lt;/P&gt;&lt;P&gt;ALP $ dire /size=all DISK$VMS083ALP:[000000]PAGEFILE.SYS&lt;/P&gt;&lt;P&gt;Directory DISK$VMS083ALP:[000000]&lt;/P&gt;&lt;P&gt;PAGEFILE.SYS;6 6400128/6400128&lt;/P&gt;&lt;P&gt;alp $ cxx fsiz&lt;BR /&gt;alp $ cxxlink fsiz&lt;BR /&gt;alp $ r fsiz&lt;BR /&gt;Enter Path: DISK$VMS083ALP:[000000]PAGEFILE.SYS&lt;BR /&gt;ctime: Mon Nov 30 17:33:25 2009&lt;BR /&gt;mtime: Wed Dec 9 10:31:14 2009&lt;BR /&gt;atime: Wed Dec 9 10:31:14 2009&lt;BR /&gt;size: -1018101760&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Clearly, this is nonsense, but:&lt;/P&gt;&lt;P&gt;ALP $ write sys$output 6400128 * 512&lt;BR /&gt;-1018101760&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It's consistent nonsense.&amp;nbsp; With 64-bit file sizes (instead of 32):&lt;/P&gt;&lt;P&gt;alp $ cxx fsiz /define = _LARGEFILE /obje = fsizl&lt;BR /&gt;alp $ cxxlink fsizl&lt;BR /&gt;alp $ r fsizl&lt;BR /&gt;Enter Path: DISK$VMS083ALP:[000000]PAGEFILE.SYS&lt;BR /&gt;ctime: Mon Nov 30 17:33:25 2009&lt;BR /&gt;mtime: Wed Dec 9 10:31:14 2009&lt;BR /&gt;atime: Wed Dec 9 10:31:14 2009&lt;BR /&gt;size: 3276865536&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Using a program with more arithmetic than DCL:&lt;/P&gt;&lt;P&gt;ALP $ pipe write sys$output "6400128 * 512" | bc&lt;BR /&gt;3276865536&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you use a language like C or C++ but forget how computers do&lt;BR /&gt;arithmetic, then it's easy to become confused.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 04:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845486#M37595</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2016-03-28T04:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845624#M37596</link>
      <description>&lt;P&gt;Okay, the basic question here — lack of 64-bit — appears to have been addressed.&lt;/P&gt;&lt;P&gt;Some general suggestions going forward with this project...&lt;/P&gt;&lt;P&gt;You're apparently working on getting the Commvault client operational&amp;nbsp;on OpenVMS, and are presently getting tangled on some of what will probably be the less-involved problems. &amp;nbsp; As the work on the CommClient backup client progresses, you're particularly going to want to acquire copies of the VMS RMS Data Structures and Internals book (Kirby McCoy) and the most recent copy of the Internals and Data Structures Manual (Ruth Goldenberg) that you can find, and probably also VAXcluster Principles (Roy Davis). &amp;nbsp; &amp;nbsp; Most or all of these are out of print, but used copies are generally available. &amp;nbsp; Not necessarily cheaply. &amp;nbsp;There's also the &lt;A href="http://www.digiater.nl/openvms/freeware/v50/ods2/" target="_blank"&gt;ODS2&lt;/A&gt; description — those are old-style text files, and are not Microsoft formats — from the OpenVMS Freeware.&lt;/P&gt;&lt;P&gt;These books&amp;nbsp;will give you some background on file locking as well as some of the metadata involved with OpenVMS files. &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Why these books? &amp;nbsp; It's very common for third-party clients starting from a UNIX&amp;nbsp;client — as appears to be the case here — to get derailed by the rather substantial differences between the UNIX file system and its metadata and general lack of locking, and that of OpenVMS with RMS and the XQP, and ODS-2 and ODS-5, as well as whatever &lt;A href="http://vmssoftware.com" target="_blank"&gt;VSI&lt;/A&gt; is cooking up with their new OpenVMS file system, and particularly host-local and cluster file locking that's integrated into OpenVMS applications by default. &amp;nbsp;(Proper management of the file system metadata and of locking are where more than a few of these enterprise backup clients have cratered in their first several versions, unfortunately.)&lt;/P&gt;&lt;P&gt;You'll also definitely want to discuss this project directly with the folks at &lt;A href="http://vmssoftware.com" target="_blank"&gt;VSI&lt;/A&gt;, and see what sorts of assistance or resources&amp;nbsp;that they might or can offer here. &amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll also want to have a look at the internals of the zip and unzip tools, as this pair of tools is one of the very few open-source and portable packages that deals well with the OpenVMS metadata. &amp;nbsp; Also the &lt;A href="http://labs.hoffmanlabs.com/node/817" target="_blank"&gt;vmsbackup&lt;/A&gt; tool.&lt;/P&gt;&lt;P&gt;A backup tool&amp;nbsp;is no small project to get right, so hopefully this information can help you deliver what your customers expect.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 15:56:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845624#M37596</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2016-03-28T15:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845629#M37597</link>
      <description>&lt;P&gt;thanks a lot, I am not sure why LARGEFILE didnt come to my mind, sorry!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 16:15:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845629#M37597</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-28T16:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: lstat and file size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845630#M37598</link>
      <description>&lt;P&gt;Thank You!!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 16:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lstat-and-file-size/m-p/6845630#M37598</guid>
      <dc:creator>mpradhan</dc:creator>
      <dc:date>2016-03-28T16:18:29Z</dc:date>
    </item>
  </channel>
</rss>

