search for: d_mode

Displaying 6 results from an estimated 6 matches for "d_mode".

Did you mean: i_mode
2009 Mar 06
0
[PATCH 2/3] COM32 API: restructure DIR
...won't be able to rewind. dir->dd_fd = regs.esi.w[0]; /* Shouldn't be needed? */ if ((!(regs.eflags.l & EFLAGS_CF)) && (regs.esi.w[0] != 0)) { - newde = calloc(1, sizeof(newde)); - if (newde != NULL) { - strcpy(newde->d_name, __com32.cs_bounce); - newde->d_mode = regs.edx.w[0]; - newde->d_type = (newde->d_mode & S_IFMT) >> 12; - newde->d_size = regs.eax.l; - newde->d_ino = regs.ebx.l; - dir->dd_stat = 1; - } else { - dir->dd_stat = -2; - errno = ENOMEM; - } + newde = dir->dd_de; + strcpy(newde->d...
2009 Feb 11
1
[PATCH 1/1] COM32 API: Add functions for directory use
...define _DIRENT_H + +#include <klibc/extern.h> +#include <klibc/compiler.h> +#include <stddef.h> +#include <sys/types.h> + +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif + +struct dirent { + long d_ino; /* Inode/File number */ + off_t d_size; /* Size of file */ + mode_t d_mode; /* Type of file */ + char d_name[NAME_MAX + 1]; +}; + +typedef struct { + short dd_stat; /* status return from last lookup */ + uint16_t dd_fd; + size_t dd_sect; + char dd_name[NAME_MAX + 1]; /* directory */ +} DIR; + +__extern DIR *opendir(const char *); +__extern struct dirent *readdir(DIR...
2008 Dec 04
0
[PATCH 1/1] COM32: Add directory functions
...define _DIRENT_H + +#include <klibc/extern.h> +#include <klibc/compiler.h> +#include <stddef.h> +#include <sys/types.h> + +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif + +struct dirent { + long d_ino; /* Inode/File number */ + off_t d_size; /* Size of file */ + mode_t d_mode; /* Type of file */ + char d_name[NAME_MAX + 1]; +}; + +typedef struct { + short dd_stat; /* status return from last lookup */ + uint16_t dd_fd; + size_t dd_sect; + char dd_name[NAME_MAX + 1]; /* directory */ +} DIR; + +__extern DIR *opendir(const char *); +__extern struct dirent *readdir(DIR...
2009 Mar 01
0
[PATCH 1/3] COMBOOT API: Improve readdir
From: Gene Cumm <gene.cumm at gmail.com> COMBOOT API: Improve readdir. Now returns C struct stat st_mode compatible data in DX rather than the raw data from a FAT filesystem or C struct dirent d_mode compatible data. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- If I return something that's compatible with the C struct stat st_mode member, this can be used for more that just determining the type of file. It might be forseeable that something else in st_mode may prove usefu...
2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...s_de_size */ + +/* Retrieve the size and mode of a file + * filestr directory name of directory entry + * de directory entry + */ +int rosh_ls_de_size_mode(const char *filestr, struct dirent *de, + mode_t *st_mode) +{ + int de_size; + +#ifdef __COM32__ + de_size = de->d_size; + *st_mode = de->d_mode; +#else /* __COM32__ */ + char filestr2[ROSH_PATH_SZ + 1]; + int file2pos; + struct stat fdstat; + int status; + + filestr2[0] = 0; + file2pos = -1; + fdstat.st_size = 0; + fdstat.st_mode = 0; + if (filestr) { + file2pos = strlen(filestr); + memcpy(filestr2, filestr, file2pos); + filestr2[file2p...
2009 Feb 15
2
COM32 module: Read-Only shell
...opendir(filestr); + if (d != NULL) { +printf("DIR:'%s' %8d %8d\n", d->dd_name, d->dd_fd, d->dd_sect); + de = readdir(d); + while (de != NULL) { + filepos++; +#ifdef DO_DEBUG +// if (strlen(de->d_name) > 25) de->d_name[25] = 0; + switch (de->d_mode) { + case 16 : ty = 'D'; break; + case 32 : ty = 'F'; break; + default : ty = '*'; + } + printf("@%8d:%8d:%4d ", (int)de->d_ino, (int)de->d_size, de->d_mode); +#endif /* DO_DEBUG */ +// printf("%s\n", de->d_name); +pri...