<?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 Query regarding CTRL ftruncate call in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182621#M26566</link>
    <description>Hi, &lt;BR /&gt;   I am new to OpenVMS. I am writing some sample programs to basically change the EOF of a stream file. I am changing the EOF to some large number 1GB using the ftruncate call, but my clients gets a timeout error since ftruncate taking more time to reply. The reason behind this is ftruncate does fill the gap between old EOF to new EOF with zeroes.&lt;BR /&gt; &lt;BR /&gt;   In my case , client is just asking to set EOF so that in future it might need that much space, but for more that 1GB files client is timing out. Is there any alternative the change EOF without filling the empty space with zeros. &lt;BR /&gt;&lt;BR /&gt;   On UNIX, ftruncate does fill the gap, it instead creates SPARSE file. If any one can help regarding this i would be glad. &lt;BR /&gt;If I am posting in wrong forum, please excuse me. &lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Ambika&lt;BR /&gt;</description>
    <pubDate>Fri, 19 Jun 2009 02:58:27 GMT</pubDate>
    <dc:creator>ambika_1</dc:creator>
    <dc:date>2009-06-19T02:58:27Z</dc:date>
    <item>
      <title>Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182621#M26566</link>
      <description>Hi, &lt;BR /&gt;   I am new to OpenVMS. I am writing some sample programs to basically change the EOF of a stream file. I am changing the EOF to some large number 1GB using the ftruncate call, but my clients gets a timeout error since ftruncate taking more time to reply. The reason behind this is ftruncate does fill the gap between old EOF to new EOF with zeroes.&lt;BR /&gt; &lt;BR /&gt;   In my case , client is just asking to set EOF so that in future it might need that much space, but for more that 1GB files client is timing out. Is there any alternative the change EOF without filling the empty space with zeros. &lt;BR /&gt;&lt;BR /&gt;   On UNIX, ftruncate does fill the gap, it instead creates SPARSE file. If any one can help regarding this i would be glad. &lt;BR /&gt;If I am posting in wrong forum, please excuse me. &lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Ambika&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jun 2009 02:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182621#M26566</guid>
      <dc:creator>ambika_1</dc:creator>
      <dc:date>2009-06-19T02:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182622#M26567</link>
      <description>&lt;!--!*#--&gt;If you're creating the file, then you should&lt;BR /&gt;be able to specify one of those VMS-specific&lt;BR /&gt;creat()/open()/fopen() options like&lt;BR /&gt;"alq = n" (and its friends).&lt;BR /&gt;&lt;BR /&gt;HELP CRTL creat Arguments&lt;BR /&gt;&lt;BR /&gt;You still may need to worry about high-water&lt;BR /&gt;marking on the file system, so it may still&lt;BR /&gt;not be as quick as you might like.&lt;BR /&gt;&lt;BR /&gt;alp $ show device /full alp$dka0:&lt;BR /&gt;&lt;BR /&gt;Disk ALP$DKA0:, device type IBM-ESXS ST336605LC !#, is online, mounted, file-&lt;BR /&gt;    oriented device, shareable, served to cluster via MSCP Server, error logging&lt;BR /&gt;    is enabled.&lt;BR /&gt;[...]&lt;BR /&gt;  Volume Status:  ODS-2, subject to mount verification, protected subsystems&lt;BR /&gt;      enabled, file high-water marking, write-through caching enabled.&lt;BR /&gt;&lt;BR /&gt;If you're not creating the file, then some&lt;BR /&gt;RMS-level code may be faster than the CRTL&lt;BR /&gt;ftruncate(), but I don't know about that.&lt;BR /&gt;It's possible that ftruncate() is slow&lt;BR /&gt;because the file's default extend quantity is&lt;BR /&gt;small, so it's doing the I/O in little&lt;BR /&gt;pieces.  ("deq = n" can affect that, as can&lt;BR /&gt;a DCL SET RMS_DEFAULT command.)</description>
      <pubDate>Fri, 19 Jun 2009 03:25:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182622#M26567</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-06-19T03:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182623#M26568</link>
      <description>Hi Steven, &lt;BR /&gt;     Thanks for a quick response. Client wont be knowing the size initially, its trying to set the EOF at the later point of time. So i cant specify it while creating the file. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Ambika&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jun 2009 03:37:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182623#M26568</guid>
      <dc:creator>ambika_1</dc:creator>
      <dc:date>2009-06-19T03:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182624#M26569</link>
      <description>Ambika,&lt;BR /&gt;&lt;BR /&gt;Steven already touched the subject:&lt;BR /&gt;&lt;BR /&gt;CHECK the relevant disk for FILE HIGHWATER MARKING. (Which _IS_ the default!!)&lt;BR /&gt;&lt;BR /&gt;If it is set, ANY extending of the file WILL force a full overwrite of ALL new allocation.&lt;BR /&gt;A simple &lt;BR /&gt;$ SET VOLUME /NOHIGH &lt;DEVICESPECIFICATION&gt;&lt;BR /&gt;will take virtually no time, and THEN the forced overwrite will no longer occur.&lt;BR /&gt;&lt;BR /&gt;_DO_ realise that this means that read access to the file then implies the ability to read what was in that/those location(s) on the drive, so that might mean a violation of your local security. Only you(r site) know if that is considered an issue (it rarely is).&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;/DEVICESPECIFICATION&gt;</description>
      <pubDate>Fri, 19 Jun 2009 07:03:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182624#M26569</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2009-06-19T07:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182625#M26570</link>
      <description>Sounds like your client really wants to get ALLOCATED blocks, but not change the EOF.&lt;BR /&gt;This can easily be done on OpenVMS using the SYS$EXTEND call. &lt;BR /&gt;They have to choose between using the ACC_CALLBACK to get access to the FAB that the C-RTL uses, or just call RMS directly. &lt;BR /&gt;Attached is an (excessive for your purpose) example of calling extend from C.&lt;BR /&gt;&lt;BR /&gt;Pre-allocation speed is independent of High-Water-Marking. That only come into play when the EOF,  is increased.&lt;BR /&gt;&lt;BR /&gt;OpenVMS does not have sparse files.&lt;BR /&gt;For some purposes you could use INDEXED files to get some of the behaviour of a sparse file with the requirement that there is a (unique) primary key identifiable within each record.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jun 2009 10:27:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182625#M26570</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-06-19T10:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182626#M26571</link>
      <description>I had to re-reply, and forgot the attachment.&lt;BR /&gt;retry.&lt;BR /&gt;Hein.</description>
      <pubDate>Fri, 19 Jun 2009 10:29:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182626#M26571</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-06-19T10:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182627#M26572</link>
      <description>Ambika,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  In my case , client is just asking to set &lt;BR /&gt;&amp;gt;EOF so that in future it might need that &lt;BR /&gt;&amp;gt;much space&lt;BR /&gt;&lt;BR /&gt;  As others have pointed out, this is achieved in OpenVMS by (pre)allocating space to the file, without moving the EOF. Using Hein's example code, you should be able to write a routine "fallocate" to do it for you.&lt;BR /&gt;&lt;BR /&gt;  That said, is there any real advantage to preallocating space to the file? We know there's a disadvantage (this post!). The OpenVMS file system is quite capable of allocating space when it's required. It's unlikely any real world application would notice or care about the performance of the extend, and with sensible cluster and default extend sizes, fragmentation isn't much of an issue. &lt;BR /&gt;&lt;BR /&gt;  Perhaps this part of the code is a throwback to times when file extensions were expensive, or disk space was scarce enough that it made sense to hoard it up front?&lt;BR /&gt;&lt;BR /&gt;  Maybe the simplest solution is to remove this section of code and let OpenVMS handle the issue of file extension?</description>
      <pubDate>Sun, 21 Jun 2009 22:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182627#M26572</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-06-21T22:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182628#M26573</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] It's unlikely any real world&lt;BR /&gt;&amp;gt; application would notice or care about the&lt;BR /&gt;&amp;gt; performance of the extend, [...]&lt;BR /&gt;&lt;BR /&gt;Oh, I might dispute that.  The CRTL/RMS&lt;BR /&gt;default extend size is so small, that a&lt;BR /&gt;zillion small extensions can be noticeably&lt;BR /&gt;slower than a single equivalent non-default&lt;BR /&gt;(big) extension.&lt;BR /&gt;&lt;BR /&gt;If you have doubts, try using a program like&lt;BR /&gt;gzip to expand some big-ish thing with the&lt;BR /&gt;default extension quantity, and then with a&lt;BR /&gt;bigger, non-default extension quantity.  I&lt;BR /&gt;claim that the difference is pretty easy to&lt;BR /&gt;notice.  ("fop=sqo" can help, too, if you&lt;BR /&gt;don't break the rules.)</description>
      <pubDate>Mon, 22 Jun 2009 01:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182628#M26573</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-06-22T01:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182629#M26574</link>
      <description>Hi All, &lt;BR /&gt;    Thanks a lot for the quick and detailed responses.&lt;BR /&gt;    I will modify my client by removing the allocation of space in the earlier stage. As John mentioned, for the further writes, OpenVMS itself will allocate the space when required. Client need not worry about it. &lt;BR /&gt;&lt;BR /&gt;    Once again thanks allot for the responses. I will close the post. &lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Ambika&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jun 2009 03:16:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182629#M26574</guid>
      <dc:creator>ambika_1</dc:creator>
      <dc:date>2009-06-22T03:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding CTRL ftruncate call</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182630#M26575</link>
      <description>Thanks for the quick help in analyzing the problem.</description>
      <pubDate>Mon, 22 Jun 2009 03:18:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/query-regarding-ctrl-ftruncate-call/m-p/5182630#M26575</guid>
      <dc:creator>ambika_1</dc:creator>
      <dc:date>2009-06-22T03:18:45Z</dc:date>
    </item>
  </channel>
</rss>

