Home > Archive > PERL Beginners > September 2004 > How Can I rename File using Perl?..
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How Can I rename File using Perl?..
|
|
| Roime bin Puniran 2004-09-30, 11:24 am |
| How can i rename any file using PERL?...Where should i start?..Where i =
can find any tutorial?
This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
| |
| NYIMI Jose \ 2004-09-30, 11:24 am |
|
> -----Original Message-----
> From: Roime bin Puniran [mailto:roime@rndtm.net.my]=20
> Sent: Thursday, September 30, 2004 11:20 AM
> To: beginners@perl.org
> Subject: How Can I rename File using Perl?..
>=20
>=20
> How can i rename any file using PERL?...Where should i=20
> start?..Where i can find any tutorial?
C:\>perldoc -f rename
rename OLDNAME,NEWNAME
Changes the name of a file; an existing file NEWNAME will be
clobbered. Returns true for success, false otherwise.
Behavior of this function varies wildly depending on your system
implementation. For example, it will usually not work across
file system boundaries, even though the system *mv* command
sometimes compensates for this. Other restrictions include
whether it works on directories, open files, or pre-existing
files. Check perlport and either the rename(2) manpage or
equivalent system documentation for details.
C:\>
C:\>perldoc perldoc
to learn how to use perldoc
HTH,
Jos=E9.
**** DISCLAIMER ****
"This e-mail and any attachment thereto may contain information which is co=
nfidential and/or protected by intellectual property rights and are intende=
d for the sole use of the recipient(s) named above.=20
Any use of the information contained herein (including, but not limited to,=
total or partial reproduction, communication or distribution in any form) =
by other persons than the designated recipient(s) is prohibited.=20
If you have received this e-mail in error, please notify the sender either =
by telephone or by e-mail and delete the material from any computer".
Thank you for your cooperation.
For further information about Proximus mobile phone services please see our=
website at http://www.proximus.be or refer to any Proximus agent.
| |
| Gavin Henry 2004-09-30, 11:24 am |
| Roime bin Puniran said:
> How can i rename any file using PERL?...Where should i start?..Where i
can find any tutorial?
using linux:
man mv
you can use a system() call or backticks ``
>
> This e-mail and any attachments may contain confidential and
> privileged information. If you are not the intended recipient,
> please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
> information by a person other than the intended recipient is
> unauthorized and may be illegal.
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
--
Just getting into the best language ever...
Fancy a yourname@perl.me.uk? Just ask!!!
| |
| Chris Cole 2004-09-30, 11:24 am |
| On Thu, 30 Sep 2004 11:18:08 +0100, Gavin Henry wrote:
> Roime bin Puniran said:
> can find any tutorial?
>
> using linux:
>
> man mv
>
> you can use a system() call or backticks ``
>
Why would you want to do that when you've got a specific perl command?
| |
| Chris Devers 2004-09-30, 11:24 am |
| On Thu, 30 Sep 2004, Gavin Henry wrote:
> Roime bin Puniran said:
>
> using linux:
>
> man mv
>
> you can use a system() call or backticks ``
The question wasn't how to do this with Linux though, it was about how
to use Perl.
The message headers suggest that Roime is using Windows --
Content-Type: text/plain;
charset="Windows-1252"
-- so the other response about the rename command was appropriate.
Moreover, rename() is a basic part of Perl, so even on Linux there is no
need to do this with a system call to the `mv` command.
--
Chris Devers
| |
| Gavin Henry 2004-09-30, 3:57 pm |
| > Moreover, rename() is a basic part of Perl, so even on Linux there is no
> need to do this with a system call to the `mv` command.
Of course, doh.
--
Just getting into the best language ever...
Fancy a yourname@perl.me.uk? Just ask!!!
|
|
|
|
|