[Zope] TEXT FILE Operation

2000-09-12 Thread Marcello Lupo

Hi to all,
anyone know how to let Zope interact with text files on the system on it
is running.
Like making changes to files, search and replare some text or insert or
delete text and save the file again?
I'm pretty new and i don't know if it is possible for Zope.
Thank You in advice.
Marcello

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] TEXT FILE Operation

2000-09-12 Thread Rik Hoekstra

 anyone know how to let Zope interact with text files on the system on it
 is running.

I take it you mean files external to the ZODB database

 Like making changes to files, search and replare some text or insert or
 delete text and save the file again?
 I'm pretty new and i don't know if it is possible for Zope.

You can just about anything you want using external methods (written in
Python) or Python Products, including reading, writing, deleting and
changing and using regular expressions. Be aware of security issues,
though, as you'll effectively be opening up part of your filesystem to
access through the web

Rik

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] TEXT FILE Operation

2000-09-12 Thread Marcello Lupo

Thank you,
infact this is the problem, right now i'm not able to program in python
but only on using zope.
I used the FSSession product before and i think that should be a Similar
product to make changes on files.
thank you for the help.

Marcello


Rik Hoekstra wrote:
 
  anyone know how to let Zope interact with text files on the system on it
  is running.
 
 I take it you mean files external to the ZODB database
 
  Like making changes to files, search and replare some text or insert or
  delete text and save the file again?
  I'm pretty new and i don't know if it is possible for Zope.
 
 You can just about anything you want using external methods (written in
 Python) or Python Products, including reading, writing, deleting and
 changing and using regular expressions. Be aware of security issues,
 though, as you'll effectively be opening up part of your filesystem to
 access through the web
 
 Rik

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] TEXT FILE Operation

2000-09-12 Thread Rik Hoekstra

 infact this is the problem, right now i'm not able to program in python
 but only on using zope.

Hm, you'd be surprised how easy the Python bit is. THere is excellent
documentation at the Python site (http://www.python.org)

 I used the FSSession product before and i think that should be a Similar
 product to make changes on files.

It seems to me the problem is too general to be able to make a sensible
product to deal with it.

 thank you for the help.
 

You could also have a look at the LocalFS product
(http://www.zope.org/Members/jfarr/Products/LocalFS). It will let you
incorporate local directories into your Zope site as if they were inside
Zope

There is also some documentation about writing files outside Zope
(http://www.zope.org/Members/sabaini/externalfiles-howto)

Perhaps this will get you started some more

Rik

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] TEXT FILE Operation

2000-09-12 Thread Phil Harris

Marcello,

I'd say the simplest way is to create an external method, something like
(untested):

def addToTextFile(self, thingToAdd = None):
if thingToAdd:
f=open('thefile','w')
f.write(thingToAdd+'\n')
f.close()

or similar for changing/updating etc.

If you are short on experience for external methods, refer to the Zope
documentation (?) for advice.

hth

phil
[EMAIL PROTECTED]

- Original Message -
From: "Marcello Lupo" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 12, 2000 11:02 AM
Subject: [Zope] TEXT FILE Operation


 Hi to all,
 anyone know how to let Zope interact with text files on the system on it
 is running.
 Like making changes to files, search and replare some text or insert or
 delete text and save the file again?
 I'm pretty new and i don't know if it is possible for Zope.
 Thank You in advice.
 Marcello

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )