Ulrich Wisser writes:
 > How can I detect if mylfs is a file or a directory?
I fear that is a difficult question.

  For unknown reasons, the builtin Python function "type" is
  considered unsafe (and would not help anyway). Thus,
  you cannot test for types.

  In PythonScript you have the function "same_type"
  that can be used to check whether two type
  are identical.
  I do not know, how well this function works with
  acquisition wrappers.

  There there is "isinstance". As I heard (but did not
  verify) there should be problems with ExtensionClass
  and Acquisition, as well.

Thus, I would not try to determine, whether it is a directory
or file. Instead, I would go for the interface based approach.
Ask yourself, what operations you would need for a directory
or file, respectively. Check for these operations to
differenciate between the two.


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

Reply via email to