Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: locking over the network

by rowdog (Curate)
on Feb 02, 2011 at 01:46 UTC ( #885645=note: print w/ replies, xml ) Need Help??


in reply to Re^2: locking over the network
in thread locking over the network

To be honest, I thought that the concept of hard links works only within a filesystem.

Yes, that's my understanding as well, which is why my example does its work in the current directory.

I don't know how Windows does it, but with, for example, Samba, you don't have a node number where you could hard-link to, do you?

smbclient(1) seems to support hard links but I really can't say whether perl's link command works on a samba mount.


Comment on Re^3: locking over the network
Download Code
Re^4: locking over the network (SMB link)
by tye (Cardinal) on Feb 02, 2011 at 03:20 UTC

    Perl's link works on an SMB mount of an NTFS volume (for non-ancient versions of Perl and non-ancient Windows operating systems).

    I'd be more worried about getting the link count. That is a surprisingly complex and expensive operation under NTFS, as I understand it. But simplistic testing shows that it works okay using native Win32 Perl and Cygwin Perl to a NTFS volume over SMB.

    - tye        

      Ah, I see now. It sounds like hard links aren't the best solution here. Thanks for clarifying the costs involved.

        I wouldn't disqualify hard links. stat itself is surprisingly complex and expensive under Windows Perl and if you haven't just given up on using Windows Perl, then it probably isn't expensive enough to be a show stopper for other uses (since stat gets used willy nilly when using Perl). (stat emulation is so slow that git implemented Windows-specific replacements in order to make a lot of stuff go noticeably faster.)

        - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885645]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2014-10-22 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (118 votes), past polls