 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Check for file lock on the IFS in RPG</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/check-for-file-lock-on-the-ifs-in-rpg/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/check-for-file-lock-on-the-ifs-in-rpg/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 20:55:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: marvmart</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/check-for-file-lock-on-the-ifs-in-rpg/#comment-62553</link>
		<dc:creator>marvmart</dc:creator>
		<pubDate>Tue, 21 Apr 2009 20:46:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-62553</guid>
		<description><![CDATA[Here is the basically the whole program. Here is what is happening. If I open an excel file on the IFS and run this program the returnint comes back with a -1 which means the file is locked. If I do the same for a text file the returnint does not come back as a -1. So I am assuming that the program did not find a lock on that file when trying to open the file. I am passing the path where the file is located on the IFS and basically whether I want to lock the file so I can process the file knowing that no one is in the file. 

 EntryPath = %trim(CompletePath) + Null;                      
 If WhatToDo = &#039;L&#039;;                                           
 ReturnInt = Open(%Trim(EntryPath):O_RDONLY+O_SHARE_NONE);    
 Return;                                                      
 Endif;                                                       
 If WhatToDo = &#039;U&#039;;                                           
   CallP Close(ReturnInt);                                    
 Return;                                                      
 EndIf;]]></description>
		<content:encoded><![CDATA[<p>Here is the basically the whole program. Here is what is happening. If I open an excel file on the IFS and run this program the returnint comes back with a -1 which means the file is locked. If I do the same for a text file the returnint does not come back as a -1. So I am assuming that the program did not find a lock on that file when trying to open the file. I am passing the path where the file is located on the IFS and basically whether I want to lock the file so I can process the file knowing that no one is in the file. </p>
<p> EntryPath = %trim(CompletePath) + Null;<br />
 If WhatToDo = &#8216;L&#8217;;<br />
 ReturnInt = Open(%Trim(EntryPath):O_RDONLY+O_SHARE_NONE);<br />
 Return;<br />
 Endif;<br />
 If WhatToDo = &#8216;U&#8217;;<br />
   CallP Close(ReturnInt);<br />
 Return;<br />
 EndIf;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.038 seconds using memcached
Object Caching 267/273 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 21:29:34 -->