dbutils.fs.ls versus pathlib.Path

chari
Contributor

Hello community members,

The dbutils.fs.ls('/') exposes the distributed file system(DBFS) on the databricks cluster. Similary, the python library pathlib can also expose 4 files in the cluster like below:

from pathlib import Path

mypath = Path('/')

for item, num in mypath.iterdir():

     print(num, item)

How do they differ and what kind of files do they allow to work with ? 

Thanks