ios - Trying to retrieve a directory list from a NAS server in my lan -


i new in swift , try find out how retrieve directory list nas server app. nas server, mac , ipad in lan.

i searched problem not find hints , still working on since days.

i tired using nsfilemanger , enumeratoraturl when change url url of local nas can not retrieve values. get:

the operation couldn’t completed. (cocoa error 260.)

only accessing device directories working.

this relevant code snippet use:

        var filemanger = nsfilemanager()         var keys = [nsurlisdirectorykey]          let url:nsurl = nsurl(string: "http://192.168.178.55/photos/")!          var handler = {             (url:nsurl!,error:nserror!) -> bool in             println(error.localizeddescription)             println(url.absolutestring)             return true         }          var enumarator = filemanger.enumeratoraturl(             url, includingpropertiesforkeys:             keys, options: nsdirectoryenumerationoptions(),             errorhandler:handler) 

is there idea how can solve issue?

regards miguel

nsfilemanager not handle http. designed work file: urls. if nas presenting readonly view of filesystem via http, you'll need use http requests, nsurlsession. how determine attributes of files , directories depends on how nas exposes information.

if nas exposing webdav, you'll need webdav client. see connectionkit , davkit (which connectionkit uses) examples.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -