Hello everyone
I just learned I can use unlink to delete files. Surprisingly I couldn't find how to do other fundamental file actions,
such as copy cu and paste without using any modules.
I did found other function which got he work "link" in them,
but the description of these function in perldoc is very unclear (at least for me),
(example: "link - Creates a new filename linked to the old filename", is that means: a copy ? a shortcut ? my interpretation: a shortcut that the system consider a regular file ???)
and I wouldn't try to use this type of functions until I'm absolutely sure what they do,
especially after reading the description for "rename" that supposedly is a lot less predictable than expected.

Thx

In Addition:
As requested by Marshall I'll further specify my intentions.
1st of all I am familiar with he inner mechanics of file handling (I've done some Assembler a decade ago),
but I've never heard about any modern operating system (I'm a windows user), that would allow multiple references to he same file without calling all but one "shortcuts".
Although it is of course technically possible.

my (well, windows's really) definitions: (sorry for the over specifying..)
* Applying cut & paste on a file, is (as far as the common non-programmer user concerns) moving it from 1 directory to another, so it exists in the new directory, but no longer exists in the old one.
* Applying copy & paste on a file, is (as far as the common non-programmer user concerns), copying it from 1 directory to other(s), so it exists in all the new directories and the old 1.
In his case the files may be (at the time of copy) identical (except for their paths ^^), but they are completely independent of each other,
so 1 (or more) may be renamed/edited/deleted/anything without affecting the others in any way.
* Applying "delete" on a file, is (as far as the common non-programmer user concerns), removing the file from existence so it can not be accessed in any way ever again.
* a shortcut, is a file that only contains one thing: a single path to a non-shortcut file.
a shortcut is referring only to the file itself by path, and so it's use is completely dependent on the file it is targeting.
if the file targeted is edited, the change will be noticeable when accessing the file through it's shortcut just as it would be when accessing it directly.
if the target file is renamed/moved/deleted the shortcut would (when accessed) be unable to find it's file target and will become useless.

Thx again

In reply to How to copy/cut and paste files without using modules ? by palkia

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.