Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found