Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Set file creation mode maskSet a file's last access ... (Berikutnya)
Functions for filehandles, files, or directories

Remove one link to a file

Daftar Isi

  • unlink LIST

  • unlink

    Deletes a list of files. On success, it returns the number of filesit successfully deleted. On failure, it returns false and sets $!(errno):

    1. my $unlinked = unlink 'a', 'b', 'c';
    2. unlink @goners;
    3. unlink glob "*.bak";

    On error, unlink will not tell you which files it could not remove.If you want to know which files you could not remove, try them oneat a time:

    1. foreach my $file ( @goners ) {
    2. unlink $file or warn "Could not unlink $file: $!";
    3. }

    Note: unlink will not attempt to delete directories unless you aresuperuser and the -U flag is supplied to Perl. Even if theseconditions are met, be warned that unlinking a directory can inflictdamage on your filesystem. Finally, using unlink on directories isnot supported on many operating systems. Use rmdir instead.

    If LIST is omitted, unlink uses $_.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Set file creation mode maskSet a file's last access ... (Berikutnya)