search for: fdstat

Displaying 5 results from an estimated 5 matches for "fdstat".

Did you mean: mdstat
2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...gument + * filestr directory name of directory entry + * de directory entry + */ +int rosh_ls_de_size(const char *filestr, struct dirent *de) +{ + int de_size; + +#ifdef __COM32__ + de_size = de->d_size; +#else /* __COM32__ */ + char filestr2[ROSH_PATH_SZ + 1]; + int fd2, file2pos; + struct stat fdstat; + int status; + + filestr2[0] = 0; + file2pos = -1; + if (filestr) { + file2pos = strlen(filestr); + memcpy(filestr2, filestr, file2pos); + filestr2[file2pos] = '/'; + } + strcpy(filestr2+file2pos+1, de->d_name); + fd2 = open(filestr2, O_RDONLY); + status = fstat(fd2, &fdstat); +...
2010 Jun 27
1
[PATCH] ROSH: Upgraded
.../* rosh_ls_arg_opt */ + +/* Retrieve the size of a file argument + * filestr directory name of directory entry + * de directory entry + */ +int rosh_ls_de_size(const char *filestr, struct dirent *de) +{ + int de_size; + char filestr2[ROSH_PATH_SZ]; + int fd2, file2pos; + struct stat fdstat; + int status; + + filestr2[0] = 0; + file2pos = -1; + if (filestr) { + file2pos = strlen(filestr); + memcpy(filestr2, filestr, file2pos); + filestr2[file2pos] = '/'; + } + strcpy(filestr2 + file2pos + 1, de->d_name); + fd2 = open(filestr2, O_RDONLY); + status = f...
2009 Feb 15
2
COM32 module: Read-Only shell
...file()); +} /* rosh_cfg */ + +/* Simple directory listing for one argument (file/directory) based on + * filestr and pwdstr + * ifilstr input filename/directory name to list + * pwdstr Present Working Directory string + */ +void rosh_dir_arg(const char *ifilstr, const char *pwdstr) +{ + struct stat fdstat; + int status; + int fd; + char filestr[ROSH_PATH_SZ + 1]; + int filepos; + DIR *d; + struct dirent *de; +#ifdef DO_DEBUG + char filestr2[ROSH_PATH_SZ + 1]; + int fd2, file2pos; +#ifdef __COM32__ +// int inchar; + char ty; +#endif /* __COM32__ */ +#endif /* DO_DEBUG */ + + /* Initialization; make...
2009 Mar 06
4
rosh patch
...9;: case '\t': - rv = 1; break; - default: rv = 0; + int rv = 0 ; + + if ( ( inc == ' ') || ( inc == '\t') ) + { + rv = 1 ; } return rv; } /* ros_issp */ @@ -384,8 +384,7 @@ if (S_ISDIR(fdstat.st_mode)) { ROSH_DEBUG("PATH '%s' is a directory\n", ifilstr); d = fdopendir(fd); - de = readdir(d); - while (de != NULL) { + while ( de = readdir(d) ) { #ifdef DO_DE...
2009 Mar 07
3
rosh patch V2
Here is a second version of my patch from last night. It uses the provided ctype function isspace and does the same readdir(). I remove the rosh_issp() function. I admit to being a bit liberal with my use of braces and spaces. We all of the habit of knowing we can invent a more perfect wheel. Let me know if you have any questions. Keith -------------- next part -------------- A non-text