Silverfrost Forums

Welcome to our forums

Win32 error detected in WrSeqFrm : The handle is invalid

24 Sep 2012 8:32 #10748

'Win32 error detected in WrSeqFrm : The handle is invalid'

Anyone seen this error?

It occurs when trying to write to a text file:

        open (99, file= tmpfil, status='new', form='formatted' ,err=999)
	write (99,'(A)') username

There isn't an error on the open call. The file is called 'F$123456.TMP' and is created but is empty (obviously!).

Any suggestions of a workaround?

K

24 Sep 2012 10:14 #10749

Hmmm, very strange... I tried this code without any problems - can you test it also to see if it runs?

      program test

      IMPLICIT NONE
 
      integer*4      rtcode
      character*120  tfile
 
      call temp_file@(tfile,rtcode)
      open(77,file=tfile,err=300,form='formatted',status='new')
      write(77,'(A)',err=300)'hello'
300   close(77)
      end

Regards - Wilfried

24 Sep 2012 10:24 #10750

Thanks for replying.

I should have said that I don't get this error myself, it only happens on a client's setup. The file is on a server. I've asked the client to see if he can edit the created file manually using notepad and he says he can. The permissions for the folder are set to 'full control' for 'everyone'.

I'm going to try sending a patch to try writing to a file without a '$' in the name, just in case that's the problem...

K

24 Sep 2012 6:26 #10752

I can confirm that the error report is generated from the Fortran IO routines in salflibc.dll but the nature of the error is not immediately obvious.

Presumably the file can be opened but write access is restricted for some reason.

25 Sep 2012 12:50 #10754

Kenny,

I would include an IOSTAT= in the open and write. This might give some more information. Also a simple program like Wilfred's would be a useful test options.

I am finding a lot of difficult restrictions with Windows 7 to 'System' directories, like C:\ and C:\WINDOWS. The latest I found was I could not copy a file to C:\ from a network directory, but could from c:\temp, after confirming that I want to !! From this it appears that Win7 treats network directories differently from local directories, which might give you some clue. It gets annoying that there are all these restrictions, even when I have administrator rights.

Have you located the virtual directory for restricted files ? \Users\<your name>\AppData\Local\VirtualStore\Windows/sdbg.ini

Work arounds appear to be there but do imply different program settings for XP and Win7

John

25 Sep 2012 1:56 #10756

Thanks for the suggestion, John.

IOSTAT returned is '10006'. Can someone suggest what that means?

K

26 Sep 2012 10:09 #10765

As far as I can tell the error for 10006 is the same as before 'Invalid handle'.

Please login to reply.