Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attempting to create file mapping (Error 1006)

Status
Not open for further replies.

ToonKayser

Programmer
Jun 20, 2000
23
DE
We use CF 3.1 and in a scheduled program I write
a textfile with cffile.
This program runs every hour and most of the time it
works fine.
But once or twice a day there is an error-message:
Error attempting to map file 'c:\......\kopf.k'
This file is the file I want ro write.
Before the program is started, another program writes
this file with a length of zero. (An empty file, yes)
In my program I append some records.

After the error-message I cannot delete the empty file
and there is nothing else for me to Stop/start the coldfusion server.
After that, I delete the file, create a new one and the program works again.
As I said, most of the time the program doesn't produce
errors and works fine.

There is another error-text: System error number 1006 occured.

Can anybody tell me what is going on?

Thanks in advance

Toon
 
hi ToonKayser

I just want to understand your goal. An existing text file needs to be appended to?

See if this code actually runs without error. It should write to a file you specify. If the file already existed it deletes it. This is just a test to see if all the file commands work in your version.

hope we can help

<CFSET outfile = &quot;c:\......\kopf.k&quot;>

<!--- start delete a file if exists --->
<CFFILE ACTION=&quot;write&quot;
FILE=&quot;#outfile#&quot;
OUTPUT=
&quot; &quot;>

<CFFILE ACTION=&quot;read&quot;
FILE=&quot;#outfile#&quot;
VARIABLE=&quot;outfileContents&quot;>


<CFIF outfileContents is not &quot; &quot;>
<CFFILE ACTION=&quot;DELETE&quot; FILE=&quot;#outfile#&quot;>
</CFIF>
<!--- delete a file if exists --->
 
Thanks.
But the problem was that - when I appended to a file - sometimes this message 1006 occured.
We Use ColdFusion 3.1

After a little research we found that if the file contains 0 Bytes (Windows NT) and when we DIDN'T append at all, the message showed.

The first thing we did in the program was test if the file exists with 'fileexists'
Even though we didn't append to the file at all, the file was 'captured' by NT.
We had to stop ColdFusion and restart it to set this file free.
So ColdFusion 3.1 can't handle files with a zero-length.
I don't know if the problem still occurs in CF 4.5

Best greetings from

Toon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top