Python to Retrieve list of file on a Network Folder

Ok I am find that if try to use any of the

os.listdir

or any other ‘os’ function it will always report back from the view of the client. even if i have the following in a project gateway script.

def ImageSearch()
import os
dir = os.listdir(’\Z:\’)
return dir

and call it from the script playground it will always retun the list from the client pc. Why is this?