[sane-devel] PATCH: Make creation of output files of scanimage batch mode atomic

Simon Matter simon.matter at invoca.ch
Thu Jan 15 07:56:30 UTC 2009


>> "m. allan noah" <kitno455 at gmail.com> wrote:
>>
>>> True enough, So, instead of using mktemp at all, why not do something
>>> like append '.part' to the image name? I think that is a little more
>>> clear to the end user if they find some hanging around after a
>>> scanimage crash or something.
>>
>> Absolutely, especially if this all happens in the working directory.
>
> It has to be in the same directory like the target files or rename() could
> fail as I understand it. But of course it's not really the current working
> directory because output filespec can include a path, relative or
> absolute.
> My intention for using mktemp() was to make sure that one scanimage
> process does in any case rename only it's own file, even if a concurrent
> scanimage process (maybe handling a different device) uses the same output
> file name.
>
> Anyway I'll remove mktemp() tomorrow.

Updated patch is attached, hope that's less confusing now.

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sane-backends-scanimage-batch-atomic-output-files.patch
Type: text/x-patch
Size: 2197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090115/6fb01bee/attachment.bin 


More information about the sane-devel mailing list