File concurrancy question
From: Rob Snyder (rsnyder_at_reversedthebrokenglass.com)
Date: 12/26/04
- Next message: Peter T. Breuer: "Re: File concurrancy question"
- Previous message: Jan Kandziora: "Re: Customizing Knoppix"
- Next in thread: Peter T. Breuer: "Re: File concurrancy question"
- Reply: Peter T. Breuer: "Re: File concurrancy question"
- Reply: Kasper Dupont: "Re: File concurrancy question"
- Reply: Nick Andrew: "Re: File concurrancy question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 26 Dec 2004 21:54:00 GMT
All -
I'm still relatively new to many aspects of Linux/unix programming, and
I apologize in advance if this is the wrong place to post this question.
I've tried to discern the answer on my own with no avail.
For sake of discussion, let's say I have a folder on my system, and a
cron job that looks something like:
for i in $(ls /myfolder)
do
lpr $i && rm -f $i
done
i.e., any syntactic errors aside, scans this folder, printing then
deleting any file therein. Easy enough.
Let's say I'm copying some big ol' file into this directory, and along
comes the cron job to print it. What happens? I'm assuming the file
shows up when the ls command executes, but when it's passed to lpr, it's
going to have only been partially copied. Will I get a printout of half
of the file? Will it get deleted?
It *seems* to do the right thing, but that is more than likely my
testing and not reality. If it isn't going to do the right thing, how do
I ensure consistency, either printing and deleting the whole file or
ignoring it till next pass?
This seems like it should be easy, and I've seen lots of example scripts
that do various things and seem to be implicitly relying on *the right
thing* happening; I just don't see how the proper behavior is enforced
by the OS, or how to enforce it if it isn't.
Thanks, in advance, for any help.
Rob Snyder
- Next message: Peter T. Breuer: "Re: File concurrancy question"
- Previous message: Jan Kandziora: "Re: Customizing Knoppix"
- Next in thread: Peter T. Breuer: "Re: File concurrancy question"
- Reply: Peter T. Breuer: "Re: File concurrancy question"
- Reply: Kasper Dupont: "Re: File concurrancy question"
- Reply: Nick Andrew: "Re: File concurrancy question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|