36 int ls(
const char *path)
39 size_t path_sz = strlen(path) + 1;
42 memcpy(list->
path, path, path_sz);
48 errmsg =
"Unable to write LIST_FILES.";
51 fputs(
"Checking reply: \n", stderr);
58 errmsg =
"Unable to read LIST_FILES";
65 fputs(
"Operation failed.\nlast_reply=", stderr);
68 errmsg =
"`LIST_FILES` was denied.";
72 fwrite(listrep->list, 1, listrep->packetLen - 10 <=
MAX_READ ? listrep->packetLen - 10 : 1024, stdout);
75 #if !LEGO_FIXED_CONTINUE_LIST_FILES
78 size_t read_so_far = listrep->packetLen + 2 - offsetof(
LIST_FILES_REPLY, list);
79 size_t total = listrep->listSize;
81 listcon.
handle =listrep->handle;
86 int ret = listconrep->ret;
93 errmsg =
"Unable to write LIST_FILES";
100 errmsg =
"Unable to read LIST_FILES_REPLY";
105 errno = listconrep->ret;
106 fputs(
"Operation failed.\nlast_reply=", stderr);
110 errmsg =
"`LIST_FILES` was denied.";
113 fprintf(stdout,
"%s", listconrep->
list);
119 ret = listconrep->ret;
123 errmsg =
"`LIST_FILES` was successful.";
EV3_COMMAND_FIELDS u16 maxBytes
Directory contents on EV3.
Error enumerations and decriptions.
#define print_bytes(buf, len)
#define packet_alloc(type, extra)
EXTERN int(* ev3_read_timeout)(void *, u8 *, size_t, int milliseconds)
const CONTINUE_LIST_FILES CONTINUE_LIST_FILES_INIT
packed structs for the packets.
EV3_COMMAND_FIELDS u8 handle
#define MAX_READ
List files and directories at path. path is always relative to /home/root/lms2012/prjs/sys/ ...
EXTERN const char * errmsg
global variable for last error message
EV3_REPLY_FIELDS u8 handle
contains declarations for ev3 commands
EXTERN int(* ev3_write)(void *, const u8 *, size_t)
int ls(const char *path)
list contents of remote directory rem