Forum OpenACS Development: CR bug on Windows - ns_mktemp

Collapse
Posted by Ryan Gallimore on
Hi,

I may have discovered a CR bug on Windows:

http://fisheye.openacs.org/browse/OpenACS/openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl?r=1.24#l199

It looks like ns_mktemp will never be Windows compatible because /tmp is hard-coded.

ns_tmpnam appears to return the correct path on Windows and Linux.

Does anyone have other recommendations?

Regards

Collapse
Posted by Dave Bauer on
I really have no idea of the difference between these two procedures. If it works I don't see any problem with changing it. There might be other places in the toolkit that also use ns_mktemp.
Collapse
Posted by Dave Bauer on
Reading the link i see a much worse bug,

when the caller to content::revision::update_content has no temp filename passed in but the storage type is set to file, it creates a file from the text content so it can be stored correctly.

Since the caller is not aware of this temp file it can't remove it. Of course if you are using storage type "file" you should really pass in a file.

Collapse
Posted by Dave Bauer on
Fixed both bugs and simplified the code to use existing cr_create_content_file_from_string procedure. This creates the string based file directly in the CR file area.

Fixed on oacs-5-5 will be merged to HEAD with everything else.

Thanks!

Collapse
Posted by Gustaf Neumann on
Thanks Dave!