<?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: Get open files and username in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689307#M33175</link>
    <description>How to search for a string ?&lt;BR /&gt;  Open the file&lt;BR /&gt;  Loop reading record by record until EOF&lt;BR /&gt;   is the search string in this record ?&lt;BR /&gt;   if yes , go process , else continue loop.&lt;BR /&gt;&lt;BR /&gt;The VMS run-time library offers a routine &lt;BR /&gt;  STR$FIND_FIRST_SUBSTRING &lt;BR /&gt; see HELP RTL STR$ .&lt;BR /&gt;Use the file-name as the search string. If it matches, take the processname or processID from the beginning of the matched record to identify the process.</description>
    <pubDate>Thu, 15 Dec 2005 09:55:10 GMT</pubDate>
    <dc:creator>Joseph Huber_1</dc:creator>
    <dc:date>2005-12-15T09:55:10Z</dc:date>
    <item>
      <title>Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689300#M33168</link>
      <description>Hi all,&lt;BR /&gt;i have to write some fortran 90 programs. i want to check if a file is already open and which user has it open. in fortran i have no idea how to handle it. is there a possibility in vms to check if the specified file is open and to get the user? i can see the open files with show device dsa2:/files, but i need the information in a program. any idea? thanks for your help!</description>
      <pubDate>Mon, 12 Dec 2005 05:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689300#M33168</guid>
      <dc:creator>Dario Karlen</dc:creator>
      <dc:date>2005-12-12T05:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689301#M33169</link>
      <description>That information is hidden deep in the operating system and, in case of a VMScluster, can be even on a remote node.&lt;BR /&gt;&lt;BR /&gt;If the environment is under your control, how about using the lock manager to communicate across nodes - the lock value block can easily hold a PID and SYS$GETJPI[W]() work cluster-wide for many item codes.</description>
      <pubDate>Mon, 12 Dec 2005 06:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689301#M33169</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2005-12-12T06:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689302#M33170</link>
      <description>Dario,&lt;BR /&gt;Have a look at the FILES_INFO package at&lt;BR /&gt;&lt;A href="http://vms.process.com/scripts/fileserv/fileserv.com?FILES_INFO" target="_blank"&gt;http://vms.process.com/scripts/fileserv/fileserv.com?FILES_INFO&lt;/A&gt;&lt;BR /&gt;It's pretty old (1992) and written in C and Macro, but maybe it gives you a few ideas on how to do this in Fortran.&lt;BR /&gt;Regards,&lt;BR /&gt;Kris (aka Qkcl)</description>
      <pubDate>Mon, 12 Dec 2005 07:53:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689302#M33170</guid>
      <dc:creator>Kris Clippeleyr</dc:creator>
      <dc:date>2005-12-12T07:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689303#M33171</link>
      <description>&lt;BR /&gt;To find out whether a file is open is trivial. Just try opening it exclusively (NOT shared) and if that fails with a sharing violation then it must have been open!&lt;BR /&gt;&lt;BR /&gt;Now to find out who, in the cluster, has it open is much, much, more difficult. The easiest route is probably a GETLKI hunting for the lock corresponding with the file and listing the PID... on each node.&lt;BR /&gt;&lt;BR /&gt;If it is part of your application, then you may be better of defining your open file open registration method. For example, you could define your own 'file lock' with the last accessor pid, node and maybe username in the (16 bytes only) lock value block.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Dec 2005 14:52:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689303#M33171</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-12-12T14:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689304#M33172</link>
      <description>You can do it easily enough from DCL (Hey, you can do ANYTHING from DCL!).&lt;BR /&gt;&lt;BR /&gt;Do a show device/file/nosys to an output file on each cluster member (via sysman), then search the output files for the file.&lt;BR /&gt;Will give every process that has a current channel to the file, irrespective of whether the process has taken a lock or not.</description>
      <pubDate>Tue, 13 Dec 2005 02:30:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689304#M33172</guid>
      <dc:creator>Paul Jerrom</dc:creator>
      <dc:date>2005-12-13T02:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689305#M33173</link>
      <description>ok, but how can i search a string in a file in a fortran program.&lt;BR /&gt;with a dcl command no problem: search file.txt string, but how to do this in a fortran program???</description>
      <pubDate>Thu, 15 Dec 2005 09:33:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689305#M33173</guid>
      <dc:creator>Dario Karlen</dc:creator>
      <dc:date>2005-12-15T09:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689306#M33174</link>
      <description>You need to open the file, read it record by record and look for the string in the buffer. You might want to play with the string manipulation library (e.g. STR$UPCASE), because the DCL SEARCH by default does a case insensitive lookup.</description>
      <pubDate>Thu, 15 Dec 2005 09:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689306#M33174</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2005-12-15T09:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689307#M33175</link>
      <description>How to search for a string ?&lt;BR /&gt;  Open the file&lt;BR /&gt;  Loop reading record by record until EOF&lt;BR /&gt;   is the search string in this record ?&lt;BR /&gt;   if yes , go process , else continue loop.&lt;BR /&gt;&lt;BR /&gt;The VMS run-time library offers a routine &lt;BR /&gt;  STR$FIND_FIRST_SUBSTRING &lt;BR /&gt; see HELP RTL STR$ .&lt;BR /&gt;Use the file-name as the search string. If it matches, take the processname or processID from the beginning of the matched record to identify the process.</description>
      <pubDate>Thu, 15 Dec 2005 09:55:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689307#M33175</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2005-12-15T09:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get open files and username</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689308#M33176</link>
      <description>thanks, that's excatly what i need!!</description>
      <pubDate>Fri, 16 Dec 2005 01:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/get-open-files-and-username/m-p/3689308#M33176</guid>
      <dc:creator>Dario Karlen</dc:creator>
      <dc:date>2005-12-16T01:33:01Z</dc:date>
    </item>
  </channel>
</rss>

