| Ticket UUID: | 2388866 | ||
| Title: | [file tempfile] can only create file in native fs | ||
| Type: | RFE | Created on: | 2008-12-04 14:30:10 |
| Submitter: | dgp | Assigned to: | dgp |
| Subsystem: | 16. Commands A-H | Severity: | |
| Priority: | 5 Medium | Last modified: | 2009-12-14 22:03:19 |
| Status: | Open | Closed by: | dkf |
| Resolution: | None | Closed on: | 2009-12-14 10:02:16 |
| Version: | None | ||
| Description: | ||||
[file tempfile var template] is supposed to use the template as a pattern on what pathname to give the temporary file. If the directory part of the template points into a mounted vfs, though, this cannot work, since the deep guts of [file tempfile] are written in terms of native syscalls such as mkstemps() which know nothing about Tcl's collection of virtual filesystems. [fileutil::tempfile] has other design troubles, but it does not suffer from this limitation. I don't see why we should accept it from [file tempfile]. | ||||
| User Comments: | ||||
ferrieux added on 2008-12-04 21:48:44:
(I know Donal loves when I try to rewrite history, but...) May I ask why TIP#210 was accepted then ? Obviously all these matters cannot be handled more elegantly than by the script level, which provides the proper abstractions; moreover there's no real performance catch here. So what's the point of a C implementation ? hobbs added on 2008-12-05 01:23:47:
I would say this is a limitation of the implementation that can be fixed for 8.6.0. All you need to do is check if template points to a non-native area and fallback to a virtual file. I could see this potentially having issues with certain vfses, but that would be up to the end developer and their choice of vfs. dkf added on 2008-12-07 03:15:03:
Forced to use the native FS for now; attempting to put the file in a virtual FS makes that part of the template get dropped instead. This means that the temporary is available for use with OS APIs and external programs. dkf added on 2009-12-14 17:02:16:
allow_comments - 1 Since it is impossible to use a tempfile in a virtual filesystem with any non-Tcl API, why on earth would you want otherwise? Any time you need a temporary filename, it's because you're passing it off to something nasty that can't take things in some other nicer way. dgp added on 2009-12-14 21:42:43:
allow_comments - 0 data_type - 360894 converted to Feature Request. The existence of [fileutil::tempfile] demonstrates this is not infeasible. kennykb added on 2009-12-14 22:03:19:
There are still platforms - perhaps most - where [load] from a vfs requires copying the module to a temp file. If the tempfile is in a vfs that doesn't support direct loading, THEN what are we supposed to do? | ||||
