errang
asked on
need help with the watchmail command
Hey, I need to implement a watchmail command in a shell, what its supposed to do is take a file name as an argument and beep if its size changes... I was thinking it could be done with a read file command and storing the number of bytes and check if it changes like that, is it that simple or a bit more complicated?
ASKER
oh sweet... there's no built in command for that.. is there?
What do you mean by a built-in command ? For doing what ?
ASKER
a built in command to get the time stamp, or do I just need to have the shell list everything about the file and parse the time stamp from that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, that function was not the first choice on my list... lol.
>> that function was not the first choice on my list... lol.
Why not ? Were you looking for something else ?
Why not ? Were you looking for something else ?
ASKER
no no... I thought I would have to use a file listing command, and somehow parse it... this was way better =D
Heh. That's for sure - especially since the parsing would have to deal with possibly different output formats on different systems.
The most direct way to do that would be to hook into the system file operation calls, but that's rather complicated, and probably not what you'd like.
A good alternative however, is to watch the file modification timestamp, and see whether that changes.