Language question -- file = variable ?

Rajinder Yadav devguy.ca-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Aug 19 01:08:49 UTC 2011


On 11-08-16 10:41 AM, William Park wrote:
> Hi all,
>
> Is there a language which (natively or not) treats a filename like a variable in memory?  For example, to increment a counter stored in a file, you would write something like
>          /tmp/counter = /tmp/counter + 1
> which involves both read and write to a file.  If it were normal variable, then it would involve read/write to a memory instead.
>
> Python is the closest I can think of.  But, you need to create a method for read and another method for write.  And, typing more verbose than I would like.
>
If the file was xml based you can parse it with any script language that 
supports xml parsing.

In Ruby you can use active resource, which is part of ruby core, it 
allows you to access an xml file like a database.

-- 
Kind Regards,
Rajinder Yadav | http://DevMentor.org | Do Good! ~ Share Freely

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list