From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,d1c3ad67402116c7 X-Google-Attributes: gidf8c9b,public X-Google-Thread: fee84,d1c3ad67402116c7 X-Google-Attributes: gidfee84,public From: Joe Durusau Subject: Re: How to lock file from shell? Date: 1999/03/02 Message-ID: <36DC0BDD.83415130@dragon.decnet.lmco.com>#1/1 X-Deja-AN: 450396870 Content-Transfer-Encoding: 7bit References: <36DBBF44.BC07B1AD@ev.co.yu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Lockheed Martin Corporation Mime-Version: 1.0 Newsgroups: comp.unix.questions,comp.unix.osf.osf1 Well, fusers will tell you if a process has the file open. Would that suffice? Speaking only for myself, Joe Durusau Nikola Milutinovic wrote: > Hi all. > > Here is what I would like to do. I'm gonna create several account for in-bound > FTP. User with USER/PASS for those account will be able to leave files on those > account via FTP. > > Then I'll create one "pick-up" account. User with that USER/PASS will pick up > files. There will be a cron job, which will transfer files from "in-bound" > accounts to the "pick-up" account. > > Well, my problem is: how to detect that the file has been transferred? > > The idea of testing a lock on the file, looked promissing, but I have to do it > from a shell script (zsh). "cp" doesn't care if the file is under a > lock/writing. I wouldn't want to implement any kind of "heuristic behavior" - IF > filesize unchanged for past 15 min THEN copy. > > Any ideas? > > TYIA, > Nix. > -- > No flames, send money instead.