Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: Use of .pl versus .plx file extensions

by QwertyD (Pilgrim)
on Mar 22, 2004 at 01:58 UTC ( [id://338539]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Use of .pl versus .plx file extensions
in thread Use of .pl versus .plx file extensions

let a file be a file , not several streams of info that stay relevant to each other until after the first :w!

I have to disagree with you here. Certain useful metadata must be kept in sync with a file's contents. The length of the file, and the file's last modified date, for example. While you could argue that these are unneccessary, it's extremely difficult to live without them. Sure, you could have null-terminated files, but then you couldn't store binary data. (You could get around this by backslash-escaping non-terminating nulls, and then backslash-escaping every backslash, but I shudder to think of a filesystem that required any of that.). Sure, you don't *need* to know when a file was last modified, but then it's a lot harder to do incremental backups.

With those two examples, the operating system deals with keeping the metadata in sync with the file. But what about a program? In UNIX, the hasbang line we all know and love acts as metadata, because it says what program should be used to run the file (I'm a UNIX newbie, so correct me if I'm wrong about this). Port a shell script to Perl, but leave a #!/bin/sh at the top, and it's not going to work correctly if you try to execute the file.

So now that we've found an instance in which it is more convenient to store metadata about what program can understand a file, why not extend that to storing metadata about what kind of file it is? Suddenly, you can have the OS figure out what to do with the file when you open it (even more so if you store creator AND filetype metadata). Applications can figure out on their own which files they can open and process. Searching can be done for certain kinds of files.

The benefits of all this kind of metadata far outweigh the costs of maintaining it. Besides, is it even that common to have one file whose type changes often?

For more info, read John Siracusa's Metadata, The Mac, and You at ArsTechnica.


Once it's Turing complete, everything else is just syntactic sugar.
  • Comment on Re: Re: Re: Use of .pl versus .plx file extensions

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://338539]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found