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

H

Hugz

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.
 
J

Jürgen Exner

Harmit said:
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
 
H

Harmit Jhajj

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top