Closed file not really closed 
Author Message
 Closed file not really closed

I have this code that works on linux but doesn't work on win95 or NT

  close $fhAtlanta
  # file rename?-force? ?--? source ?source ...? targetDir
  file rename -force  $eofAtlanta "$eofAtlanta.bak"

I get a permission denied error. If I try to rename the file before
opening it I can. So it is not a true permission problem. It appears
that the file system does not have time to actually close the file
before I try to rename. Any suggestions.

Bob



Sun, 15 Apr 2001 03:00:00 GMT  
 Closed file not really closed
Try this:

file rename -force -- "$eofAtlanta" "$eofAtlanta.bak"

Make sure that both of the files are closed before you do this.

Quote:

> I have this code that works on linux but doesn't work on win95 or NT

>   close $fhAtlanta
>   # file rename?-force? ?--? source ?source ...? targetDir
>   file rename -force  $eofAtlanta "$eofAtlanta.bak"

> I get a permission denied error. If I try to rename the file before
> opening it I can. So it is not a true permission problem. It appears
> that the file system does not have time to actually close the file
> before I try to rename. Any suggestions.

> Bob



Sun, 15 Apr 2001 03:00:00 GMT  
 Closed file not really closed
Try this:

file rename -force -- "$eofAtlanta" "$eofAtlanta.bak"

Make sure that both of the files are closed before you do this.

Quote:

> I have this code that works on linux but doesn't work on win95 or NT

>   close $fhAtlanta
>   # file rename?-force? ?--? source ?source ...? targetDir
>   file rename -force  $eofAtlanta "$eofAtlanta.bak"

> I get a permission denied error. If I try to rename the file before
> opening it I can. So it is not a true permission problem. It appears
> that the file system does not have time to actually close the file
> before I try to rename. Any suggestions.

> Bob



Sun, 15 Apr 2001 03:00:00 GMT  
 Closed file not really closed

Quote:

> I have this code that works on linux but doesn't work on win95 or NT

>   close $fhAtlanta
>   # file rename?-force? ?--? source ?source ...? targetDir
>   file rename -force  $eofAtlanta "$eofAtlanta.bak"

> I get a permission denied error. If I try to rename the file before
> opening it I can. So it is not a true permission problem. It appears
> that the file system does not have time to actually close the file
> before I try to rename. Any suggestions.

Do you by any chance do this from within a fileevent handler ?
There is a known bug in 8.0.3 that delays [close] in this situation.
The workaround is to [after idle] all this.

-Alex



Mon, 16 Apr 2001 03:00:00 GMT  
 Closed file not really closed

Quote:


> > I have this code that works on linux but doesn't work on win95 or NT

> >   close $fhAtlanta
> >   # file rename?-force? ?--? source ?source ...? targetDir
> >   file rename -force  $eofAtlanta "$eofAtlanta.bak"

> > I get a permission denied error. If I try to rename the file before
> > opening it I can. So it is not a true permission problem. It appears
> > that the file system does not have time to actually close the file
> > before I try to rename. Any suggestions.

> Do you by any chance do this from within a fileevent handler ?
> There is a known bug in 8.0.3 that delays [close] in this situation.
> The workaround is to [after idle] all this.

> -Alex

  Yes it is a file event. I tried "update" in between the close and the
rename I never thought of "after idle".


Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Device file not closing on close command

2. mdi app not closing down, some threads just won't close #2

3. to close or not to close?

4. NT Server not releasing some files on program close

5. File not being able to close

6. NI_readwriteAVI.dll does not close file reference

7. problem with expect 5.30 and log_file not closing file

8. Strange thing: file.close did not show error but work wrong

9. CW55PE release H when I close a wizard generated application the IDE closes as well

10. tcl-dp confuses expect's close call with builtin close

11. Dangling Closing Parentheses vs. Stacked Closing Parentheses

12. close of an arbitrary stream may close *terminal-io*

 

 
Powered by phpBB® Forum Software