![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl -write values in a file to @array in perl | meghana | Shell Programming and Scripting | 27 | 06-07-2009 06:05 PM |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 6 | 05-24-2009 06:03 PM |
| [PERL] Running unix commands within Perl Scripts | userix | Shell Programming and Scripting | 1 | 05-28-2008 07:06 PM |
| Perl: Run perl script in the current process | vino | Shell Programming and Scripting | 10 | 12-09-2005 10:45 AM |
| Replace Perl Module name in all Perl scripts | rahulrathod | Shell Programming and Scripting | 2 | 12-02-2005 01:00 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
perl demon how to ?
Hello
im kinda new to perl programming in unix i need to make some kind of perl demon that sites and waits to see if there is files in the dir if there is complete file ( not part of it ) , I need to mv it to different dir ok so the easy parts to cp files and perl I know , but how the hell I make perl demon that is always listens? and how can I know in perl if file is complete (closed ) ? thanks |
|
||||
|
For socket introduction, see
http://perldoc.perl.org/perlipc.html...-Communication As for checking whether the file is being held open, I think you can't get this information. You can just assume that when, e.g. copy or move returns, that file has been moved. But you know the OS may return before this is physically completed and give you a view that the file has been relocated, but the writing is still going on (due to DMA, maybe). flocks won't work either because of its discretionary nature. The typical way is to write some dummy, hidden file to indicate the status beforehand, just as vim does. The file is cleaned when the operation completes. That's why shell scripts are usually full of this kind of tricks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|