GadgetSeed  0.9.6
file.h ファイル

ファイル [詳解]

#include "fs.h"
#include "str.h"
file.h の依存先関係図:
被依存関係図:

[ソースコード]

マクロ定義

#define SIZE_STR   "X.XM"
 
#define SIZE_STR_LEN   ((unsigned int)sizeof(SIZE_STR))
 

関数

void init_file (void)
 全てのファイルディスクリプタを初期化する
 
struct st_filesystemget_filesystem (const uchar *path)
 ファイル名からファイルシステムを調べる [詳解]
 
int open_file (const uchar *path, int flags)
 ファイルを開く [詳解]
 
t_ssize read_file (int fd, void *buf, t_size count)
 ファイルからデータを読み出す [詳解]
 
t_ssize write_file (int fd, const void *buf, t_size count)
 ファイルにデータを書き込む [詳解]
 
t_ssize seek_file (int fd, t_ssize offset, int whence)
 ファイルアクセス位置の設定 [詳解]
 
t_size tell_file (int fd)
 ファイルアクセス位置の取得 [詳解]
 
int close_file (int fd)
 ファイルを閉じる [詳解]
 
FS_DIRopendir_file (const uchar *name)
 ディレクトリを開く [詳解]
 
int readdir_file (FS_DIR *dir, FS_FILEINFO *finfo)
 ディレクトリを読み出す [詳解]
 
int closedir_file (FS_DIR *dir)
 ディレクトリを閉じる [詳解]
 
int stat_file (const uchar *path, FS_FILEINFO *finfo)
 ファイルステータスを読み出す [詳解]
 
int getfree_file (const uchar *path, unsigned long *sect, void **fs)
 論理ドライブの未使用クラスタ数を取得する [詳解]
 
int sync_file (int fd)
 キャッシュされたデータをフラッシュする [詳解]
 
int unlink_file (const uchar *path)
 ファイルを消去する [詳解]
 
int mkdir_file (const uchar *path)
 ディレクトリを作成する [詳解]
 
int chmod_file (const uchar *path, unsigned char flag)
 
int rename_file (const uchar *oldpath, const uchar *newpath)
 ファイル/ディレクトリ名を変更する [詳解]
 
int mkfs_file (const uchar *path, unsigned char part, unsigned short alloc)
 
ucharget_last_filename (uchar *filename, const uchar *fullpath, unsigned int len)
 ファイルパスからファイル名のみを取得する [詳解]
 
ucharget_filename_extension (uchar *ext, const uchar *filename, unsigned int len)
 ファイル拡張子を取得する [詳解]
 
char * size2str (char *str, t_size size)
 

詳解

ファイル

日付
2008.03.20
著者
Takashi SHUDO

file.h に定義があります。

関数詳解

◆ close_file()

int close_file ( int  fd)

ファイルを閉じる

引数
[in]fdファイルディスクリプタ
戻り値
0:成功

file.c297 行目に定義があります。

◆ closedir_file()

int closedir_file ( FS_DIR dir)

ディレクトリを閉じる

引数
[in]dirディレクトリ
戻り値
エラーコード

file.c382 行目に定義があります。

◆ get_filename_extension()

uchar* get_filename_extension ( uchar ext,
const uchar filename,
unsigned int  len 
)

ファイル拡張子を取得する

引数
[out]拡張子文字列
[in]ファイル名
[in]最大拡張子文字列バイト数
戻り値
拡張子文字列

file.c676 行目に定義があります。

参照先 strleng(), strncopy().

呼び出し関係図:

◆ get_filesystem()

struct st_filesystem* get_filesystem ( const uchar path)

ファイル名からファイルシステムを調べる

引数
pathファイル名
戻り値
ファイルシステム

file.c120 行目に定義があります。

参照先 get_diskno(), GSC_FS_VOLUME_NUM.

呼び出し関係図:

◆ get_last_filename()

uchar* get_last_filename ( uchar filename,
const uchar fullpath,
unsigned int  len 
)

ファイルパスからファイル名のみを取得する

引数
[out]filenameファイル名
[in]fullpathファイルパス名
[in]len最大ファイル名バイト数
戻り値
ファイル名

file.c633 行目に定義があります。

参照先 strleng(), strncopy().

呼び出し関係図:

◆ getfree_file()

int getfree_file ( const uchar path,
unsigned long *  sect,
void **  fso 
)

論理ドライブの未使用クラスタ数を取得する

引数
[in]pathファイル(ドライブ)名
[out]sect
[out]fs
戻り値
エラーコード

file.c437 行目に定義があります。

◆ mkdir_file()

int mkdir_file ( const uchar path)

ディレクトリを作成する

引数
[in]pathディレクトリ名
戻り値
エラーコード

file.c515 行目に定義があります。

◆ open_file()

int open_file ( const uchar path,
int  flags 
)

ファイルを開く

引数
pathファイル名
flags属性フラグ
戻り値
ファイルディスクリプタ(0:エラー)

file.c144 行目に定義があります。

◆ opendir_file()

FS_DIR* opendir_file ( const uchar name)

ディレクトリを開く

引数
[in]nameディレクトリ名
戻り値
ディレクトリ(0:エラー)

file.c329 行目に定義があります。

◆ read_file()

t_ssize read_file ( int  fd,
void *  buf,
t_size  count 
)

ファイルからデータを読み出す

引数
[in]intファイルディスクリプタ
[out]buf読み出しデータポインタ
[in]count読み出しバイト数
戻り値
読み出しバイト数(<0:エラー)

file.c188 行目に定義があります。

◆ readdir_file()

int readdir_file ( FS_DIR dir,
FS_FILEINFO finfo 
)

ディレクトリを読み出す

引数
[in]dirディレクトリ
[out]infoファイル情報
戻り値
エラーコード

file.c356 行目に定義があります。

◆ rename_file()

int rename_file ( const uchar oldpath,
const uchar newpath 
)

ファイル/ディレクトリ名を変更する

引数
[in]oldpath変更されるファイル名
[in]newpath変更後のファイル名
戻り値
エラーコード

異なるデバイスへの名前変更はできない

file.c573 行目に定義があります。

◆ seek_file()

t_ssize seek_file ( int  fd,
t_ssize  offset,
int  whence 
)

ファイルアクセス位置の設定

引数
[in]fdファイルディスクリプタ
[in]offset移動バイト数
[in]whence移動基準位置
戻り値
先頭からのオフセット位置バイト数

file.c244 行目に定義があります。

◆ stat_file()

int stat_file ( const uchar path,
FS_FILEINFO finfo 
)

ファイルステータスを読み出す

引数
[in]pathファイル(ディレクトリ)名
[out]infoファイル情報構造体ポインタ
戻り値
エラーコード

file.c409 行目に定義があります。

◆ sync_file()

int sync_file ( int  fd)

キャッシュされたデータをフラッシュする

引数
[in]fdファイルディスクリプタ
戻り値
エラーコード

file.c463 行目に定義があります。

◆ tell_file()

t_size tell_file ( int  fd)

ファイルアクセス位置の取得

引数
[in]fdファイルディスクリプタ
戻り値
先頭からのオフセット位置バイト数

file.c270 行目に定義があります。

◆ unlink_file()

int unlink_file ( const uchar path)

ファイルを消去する

引数
[in]pathファイル名
戻り値
エラーコード

file.c489 行目に定義があります。

◆ write_file()

t_ssize write_file ( int  fd,
const void *  buf,
t_size  count 
)

ファイルにデータを書き込む

引数
[in]fdファイルディスクリプタ
[in]buf書き込みデータポインタ
[in]count書き込みバイト数
戻り値
書き込みバイト数(<0:エラー)

file.c216 行目に定義があります。