Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^4: Directory Separator (none)

by vsespb (Chaplain)
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 '/'

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-10-26 11:06 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.