<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Problem writing to file - sometimes]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=795&amp;type=atom" />
	<updated>2021-01-03T15:27:00Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=795</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file - sometimes]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3671#p3671" />
			<content type="html"><![CDATA[<p>First, can you try running the executable in your new directory from a command prompt?&nbsp; It sounds like you&#039;re double-clicking in Windows Explorer, which might mean that any errors being printed are being obscured by the windows opening and closing too fast.</p><p>Also, does your executable rely on any libraries or DLLs?</p><p>Finally, can you make sure that your executable is statically linked?&nbsp; In Project Options under Linker, &quot;All Static&quot; should be checked to ensure the executable isn&#039;t trying to use any DLLs.&nbsp; I doubt this is the issue, but it can&#039;t hurt to check.&nbsp; </p><p>You might have to add some debugging information to your program, though, to see why it isn&#039;t running in a different directory.&nbsp; The compiler doesn&#039;t embed any path information in executables, so it really shouldn&#039;t matter.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2021-01-03T15:27:00Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3671#p3671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file - sometimes]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3670#p3670" />
			<content type="html"><![CDATA[<p>Hi Jeff, I write, compile and debug my fortran code in c:\users\imre\fortran\time4taxv3 . This directory has my source code, the .exe file, all the input and output files etc. When I run the code from this directory every thing works good.</p><p>I wanted to move the actual running of the code to c:\users\imre\documents\taxes\2020.taxes ... I do not want someone to erase or change the source code accidentally. I copied the 3 .txt input files to the 2020.taxes directory an ran c:\users\imre\fortran\time4taxv3\time4taxv3.exe . The code seemed to be running ok but it would not write to either output file. I got no errors and I got no output.</p><p>I then copied c:\users\imre\fortran\time4taxv3\time4taxv3.ex to the 2020.taxes directory ... same thing, no errors and no output.</p><p>When I open the output files I do not specify the full pathname, I do the fillowing:</p><br /><p>&nbsp; &nbsp; &nbsp;arg1=&quot;taxout.txt&quot;</p><p>&nbsp; &nbsp; &nbsp;open(unit=120,file=arg1,position=&quot;append&quot;,action=&quot;write&quot;,IOMSG=erroro,err=125,iostat=ir)</p><p>&nbsp; &nbsp; &nbsp;write (unit=120,fmt=123,err=125,iostat=ist) date,vendor,cost,taxcat,addres,desc<br />123&nbsp; format (5a1,1x,20a1,1x,8a1,1x,20a1,1x,20a1,1x,20a1)</p><br /><br /><br /><p>Thank You !!</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2021-01-01T16:08:49Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3670#p3670</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem writing to file - sometimes]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3664#p3664" />
			<content type="html"><![CDATA[<p>Could you clarify things a bit more?&nbsp; When you say:</p><div class="quotebox"><blockquote><p>But, if I run it under a user directory...</p></blockquote></div><p>what exactly do you mean by this?&nbsp; Are you running it from Simply Fortran still?&nbsp; &nbsp;Are you launching it from Windows Explorer?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2020-12-31T12:47:44Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3664#p3664</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem writing to file - sometimes]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3661#p3661" />
			<content type="html"><![CDATA[<p>I have some Fortran code that has 3 .txt files as input and 2 .txt as output. If I run the code in the directory that contains the&nbsp; .f90 source file and the .exe file all is ok. But, if I run it under a user directory the program will not write to any output file. I used the IOMSG= err= and iostat ... none of them return abnormal values. I&#039;m not getting any output ... and I&#039;m not getting any errors. </p><p>All advice would be appreciated, Thanks</p>]]></content>
			<author>
				<name><![CDATA[imre_varga]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3807</uri>
			</author>
			<updated>2020-12-30T22:22:59Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3661#p3661</id>
		</entry>
</feed>
