By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,795 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,795 IT Pros & Developers. It's quick & easy.

New To Perl :- Help with "rename" and "File locking"

P: n/a
Hello,
And Thank you for taking time to help me.Myself Hugz.I am new to
perl and want to write my own Scripts.But i can't understand how perl
"rename" function and "file locking" works.

Actually i am running a WinME with ActivePerl 5.8.0, what i want to
know is

1.What do you mean by "file creation (and deletion) is not atomic over
NFS" ?
2.What is NFS?
3.How do lock a File under Windows/Unix/Linux ?
4.How do you rename a file reliably on Windows/Unix/Linux ?
5.Why can't i use the following code to lock files ?

sleep(3) while -e "file.lock"; # PLEASE DO NOT USE
open(LCK, "> file.lock"); # THIS BROKEN CODE

Please help me in any possible way.

Thank You.
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
This is Hugz Again.Please someone help me with my questions above !!!!!
Jul 19 '05 #2

P: n/a
Harmit Jhajj wrote:
This is Hugz Again.
I thought your name is Harmit?
Please someone help me with my questions above


Which question? Those in the subject line? Did you try the documentation?

perldoc -f rename
perldoc -q lock

jue
Jul 19 '05 #3

P: n/a
> I thought your name is Harmit?

Hello jue,
Yes my name is Harmit,but Hugz is my alias.Actually the
questions are in the the first post that i posted in this thread.

Which question? Those in the subject line? Did you try the documentation?

perldoc -f rename
perldoc -q lock


Yes i tried the perldocs and know how to lock and rename file but i am
a bit confused please refer to my first post and help me !!!!

Thank you.

Harmit.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.