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

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]
[Eily]: or I might be tempted to send him an Acme::EyeDropsed file next time
[Eily]: Acme::Bleach is tempting, but it will look like I'm just using the one module that does precisely exactly what he wants

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-04-26 15:18 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (483 votes). Check out past polls.