Api/netfolder

From Minux Wiki
Revision as of 22:28, 24 September 2024 by Shorun (talk | contribs)
Jump to navigation Jump to search

these api functions can be used to communicate with a file server, client side only for now.

warning: Netfolder WILL do what you ask of it, even if this means overwriting or destroying your data. careless use can result in damage.


netfolder.list(server, path)

does a recursive fs.list() on the fileserver's disk, target is "path". the result gets sent to the client and stored in /temp/netfolder/list.ls

this can then be used to "getfolder" or to find a specific file.


netfolder.delete(server, path)

deletes "path" on "server", can be either a file or folder.


netfolder.getfile(server, serverpath, localpath)

downloads a single file from "server" on location "serverpath" to local location "localpath". this is for single files that were stashed away safely for backups. will overwrite whatever is at "localpath"


netfolder.putfile(server, serverpath, localpath)

uploads a single file to "server" on location "serverpath" from local location "localpath". will overwrite whatever is at "serverpath"


netfolder.getfolder(server, serverpath)

does a recursive fs.list() on "serverpath" on the fileserver, processes the answer for download and then uses getfile to download the found files.

in effect this makes a copy of "serverpath" to your local computer, all pathnames are identical for now. it's a first version.


netfolder.putfolder(server, serverpath)

does a recursive fs.list() on "serverpath" on your local computer and then "putfile" the files found on the server, same paths as on the computer.

makes a copy of "serverpath" from the server to your computer as it finds it, all pathnames are identical for now, it's a first version.