A
Andras Malatinszky
Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
such basic operations like cp or mv?
Andras said:Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Steven said:perldoc File::Copy
Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Andras Malatinszky said:Why is it that Perl emulates Unix commands like chmod and chown but
not such basic operations like cp or mv?
Andras said:Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Andras said:Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Andras said:Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Andras said:Thanks. Unfortunately I didn't find the answer to my question in that
doc. Perhaps, if it's not too much trouble, you could quote the relevant
part?
Notice that the question was "why doesn't Perl emulate cp or mv?" or in
other words, "why didn't the designer of Perl include a cp and an mv
function?" rather than "how do I make up for the lack of cp or mv?"
Ala Qumsieh said:FWIW, Perl does have a 'mv' command. It is called 'rename'.
Chris Mattern said:perldoc File::Copy
mv also allows to name a directory as a destination, and name multipleNo... they're subtly different. mv(1) will move a file between
filesystems; rename(2) won't. See the man page for rename, particularly
the EXDEV error case.
Chris said:Andras Malatinszky wrote:
File::Copy enables you to do copies and moves. I don't understand your
point.
Good point, thanks.Ala said:FWIW, Perl does have a 'mv' command. It is called 'rename'.
--Ala
Tim said:Perl doesn't actually emulate the Unix *commands* chmod and chown,
rather it emulates the Unix *system calls* chmod and chown. Perl has
a rename command, which is just like the rename Unix system call.
The Unix chmod and chown commands are essentially wrappers around the
chmod and chown system calls, whereas the Unix cp and mv commands are
fairly sophisticated little programs; much more than just wrappers
around the rename system call. The Perl File::Copy module has the more
sophisticated copy and move functions in it (which you may even spell
cp and mv, if you prefer).
Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Andras said:Why is it that Perl emulates Unix commands like chmod and chown but not
such basic operations like cp or mv?
Bart said:On a similar note, I've always wondered why Perl had no curdir, or cwd.
Cwd() exists to solve that problem, but the question still remains.
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.