Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Directory Separator (none)

by vsespb (Hermit)
on May 28, 2013 at 23:39 UTC ( #1035749=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Directory Separator (none)
in thread Directory Separator

rsync, for one, disagrees

rsync man

this ok:

A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning “copy the contents of this directory” as opposed to “copy the directory by name”
But here we see that leading '/' sometimes does not mean root
if the pattern starts with a / then it is matched against the start of the filename, otherwise it is matched against the end of the filename.
Thus “/foo” would match a file called “foo” at the transfer-root (see above for how this is different from the filesystem-root).

I think filename is filename. It points to file. When you passing arguments to command line programs - it's different thing - sometimes you need special syntax, depending on what you want to do

"mv foo bar/" is only the same as "mv foo bar" if you are 100% sure that bar already exists and is a directory.

yep, but there are problems when it's symlink to a directory example

Also basename

In the usual case, dirname() returns the string up to, but not including, the final '/'


Comment on Re^4: Directory Separator (none)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-10-24 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (133 votes), past polls