Orkun
Orkun

Reputation: 7248

Can read opearation cause .lock in unix?

In unix, when ProcessA is reading from FileX, if ProcessB attempts to remove the FileX. Would this cause a deadlock on FileX ?

Wiki says some stuff.. from which I couldnT carve out an answer for this simple question..

Thanks in advance.

Upvotes: 0

Views: 41

Answers (1)

Brian Agnew
Brian Agnew

Reputation: 272337

No. You can remove a file whilst another process is reading it. There's no locking by default.

e.g.

$ touch a
$ tail -f a

and in another prompt

$ rm a

Upvotes: 1

Related Questions