Re: [Nolug] Monitor incoming files and...

From: B. Estrade <estrabd_at_gmail.com>
Date: Sat, 23 Jun 2012 08:14:51 -0500
Message-ID: <CALSf6fSvmkBu8U-XY=b1-TDBpAVaYnHss9ebDPaqNB9SoO3frA@mail.gmail.com>

On Sat, Jun 23, 2012 at 7:52 AM, Jimmy Hess <mysidia@gmail.com> wrote:
> On 6/22/12, Petri Laihonen <pietu@weblizards.net> wrote:
> libiconv /  PHP   mb_convert_encoding are  available as long as the
> write PHP modules are installed or compiled in.
>
> It would be ideal to inline  all this logic with your upload process,
> rather than run a separate daemon.  You should have better
> performance, and fewer chances for a race condition that way.
> Process uploads to a temporary directory,    then  create a new second
> temporary file,
> delete the original,  and  move the converted file  to a different directory
> with an atomic   rename()  operation,   to mark completion of the upload.
>
> And don't tell the remote user the upload was successful until all
> those operations succeeded.
>

This. Nice touch with the atomic mv, most people don't do that or
consider race conditions.

Brett =)

>
>> I would most likely do it with PHP script which would be running as daemon
>> managed by supervisor. (i.e. PHP does not have to daemonize itself, since
>> supervisor is doing it)
>>
>> http://php.net/manual/en/function.iconv.php
>
>> P
> --
> -JH
> ___________________
> Nolug mailing list
> nolug@nolug.org
___________________
Nolug mailing list
nolug@nolug.org
Received on 06/23/12

This archive was generated by hypermail 2.2.0 : 07/25/13 EDT