AW: AW: [Zope-dev] FileUpload and blob on Windows

Roger Ineichen dev at projekt01.ch
Tue Jan 29 12:05:23 EST 2008


hi Leo

> Betreff: Re: AW: [Zope-dev] FileUpload and blob on Windows

[...]

> I'm already using something like that, because 
> NamedTemporaryFiles on Windows disappear when they're closed, 
> *even if* they've been renamed away from the original file 
> name, but then I hit the other snag in that open files can't 
> be renamed, and even win32file hard links to open files can't 
> be renamed while the original is open
> 
> And I also tried replacing the request file with a blob file 
> opened for reading, but the request outlives the transaction, 
> so when the commit happens, the blobfile is still open and 
> BlobStorage complains. I even tried surreptitiously opening 
> the filesystem file from under blob and placing that in the 
> request, but at commit time, BlobStorage tries to rename the 
> file to it's final location, and Windows doesn't like it.
> 
> Now I'm wondering if I'll have to implement a transaction 
> manager to close a blob files before the transaction.

Probably the question is; when do you try to move the file?
I only move the file on transaction commit after 
everything is done. e.g. widget validation etc.

Is this not how blob will handle the move? Or does blob to
early move/touch the file again. I only read from the file stream
and after that I read the file size based on file system infos
which is much faster.
I never touch that file again till the transaction is commited.

What's the reason why you need to read the file again after
it is created?

Regards
Roger Ineichen



More information about the Zope-Dev mailing list