open filestream prevents file deletion on windows
Bug #997230 reported by
Dennis Knochenwefel
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
New
|
Medium
|
Markos Zaharioudakis |
Bug Description
the bug fix for bug #996084 seems to be a bit more tricky on windows. If you execute the attached example on a windows machine you will get:
user-defined error [file:FOFL9999]: An unknown error occured: "C:\data.txt": I/O error: 32 failed (error The process cannot access the file because it is being used by another process): Can not delete file: C:\data.txt; raised at zorba\modules\
The problem is that the file cannot be deleted as long as the file stream is open. This example query works on linux.
This makes the 2 tests test/rbkt/
To post a comment you must log in.
I'm tempted to call this "user error"... I agree it looks like it should work, but that assumption relies on file:read-text() materializing the file contents in memory. We don't want that, and I think we need to accept that Windows will make streaming difficult in this sense.
However, we SHOULD probably offer some function somewhere that would make it possible for a query author to do the right thing - some kind of "close" mechanism. It's possible that scoping $data in this query would be sufficient to solve this problem; Dennis, could you try that out?