| PLEX86 | ||
|
How to detect locked files 3446On Sun, 24 Apr 2005 01:08:38 GMT, Mackan staggered into the Black Sun and said: If you move it before the FTP server has finished writing, yeah, it might not be complete. Depends on how the FTP server handles it. IME, if you move the file before the write's finished, it gets truncated. OTOH, the last time I did that (several years ago), I was moving files fromwork-ftp-username-uploadtowork-in-process, and username was chrooted towork-ftp-username. Since the instance of the FTP server was chrooted, it couldn't accesswork-in-process, so it *had* to truncate. BWWWHAHHAHAHAHAA. Thank God For Win XP! 3448 Mike Cox When they do, I'll ask them to aim carefully; I don't want to get wet. Seriously, I supported people's dial-up Internet connection on... If the FTP server has write access to the directory you moved the file to, it should work. There are a number of variables though. Most FTP servers are chrooted for obvious reasons. If yours is, and you move a file-in-progress somewhere that isn't in the chroot environment, the FTP server won't be able to continue writing and the file will be truncated. Meaning of Console_ entries in keymap files I think the man page for keymap is pretty awful, but I have managed to figure out most of what I'd like to know. Some things are throwing me though. For example, just looking at... "lsof $FILE" will tell you if $FILE is open or not, if the user running lsof is root or the processes that have $FILE open are owned by the user running lsof. FTP servers close() files after they've finished writing to them. Combine those 2 things and you'll have an idea of how to proceed. If the FTP server is running as user bob, and you can't buttume user bob's idenbreasty with su or use su (or sudo) to run lsof as root, then you'll have to fall back on something like this: Use stat on the file every N seconds, check the file size, if file size is the same as it was N seconds ago, it's probably done. BWWWHAHHAHAHAHAA. Thank God For Win XP! 3449 Mike Cox Comes in handy, yanno? Particularly given the love of Flash that a lot of webmasters... Certain types of files (zip files for one) have an alternate means of checking; for zip files, the central directory signature is always in the last few bytes, and if that signature is there, the file's finished uploading. I use lsof, but then I have root on the FTP servers at ork. YMMV. HTH anyway, Why do the installed program icons go Hi. if you are looking for icons on your desktop, you can simply add them yourself by right-clicking on the desktop, selecting 'create new... -- Matt GThere is no Darkness in Eternity-But only Light too dim for us to see Brainbench MVP for Linux Admin mail: TRAP + SPAN don't belong
|
||||
Why do the installed program icons go Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||