GadgetSeed  0.9.6
com_file.c ファイル

ファイル操作コマンド [詳解]

#include "sysconfig.h"
#include "shell.h"
#include "device.h"
#include "fs.h"
#include "str.h"
#include "tprintf.h"
#include "tkprintf.h"
#include "storage.h"
#include "file.h"
#include "charcode.h"
#include "dtprintf.h"
#include "datetime.h"
#include "batch.h"
com_file.c の依存先関係図:

[ソースコード]

マクロ定義

#define FSIZE_LSTR_LEN   10
 
#define FDATA_STR_LEN   ((unsigned int)sizeof("HH:MM:DD"))
 
#define FDATA_LSTR_LEN   ((unsigned int)sizeof("YYYY/MM/DD HH:MM:DD"))
 
#define FSECTSIZE   FF_MIN_SS
 
#define FDSIZE   FSECTSIZE
 

関数

static char * fsize2str (t_size size)
 
static char * fsize2lstr (unsigned long size)
 
static char * fdate2str (t_time datetime)
 
static char * fdate2lstr (t_time datetime)
 
static void print_fresult (char *path, FRESULT fr)
 
static int scan_files (unsigned char *path, unsigned int len)
 
static int mount (int argc, uchar *argv[])
 
static int umount (int argc, uchar *argv[])
 
static int diskfree (int argc, uchar *argv[])
 
static int dir (int argc, uchar *argv[])
 
static int dirv (int argc, uchar *argv[])
 
static int delete (int argc, uchar *argv[])
 
static int fdump (int argc, uchar *argv[])
 
static int operation (int argc, uchar *argv[])
 
static int batch (int argc, uchar *argv[])
 

変数

static unsigned int now_time
 
static unsigned long acc_size
 
static unsigned short acc_files
 
static unsigned short acc_dirs
 
static const struct st_shell_command com_file_mount
 デバイスをマウントする [詳解]
 
static const struct st_shell_command com_file_umount
 デバイスをアンマウントする [詳解]
 
static char defdrive [FF_MAX_LFN+1] = "0:/"
 
static const struct st_shell_command com_file_diskfree
 ドライブの空き容量を表示する [詳解]
 
static const struct st_shell_command com_file_dir
 ドライブのファイルリストを表示する [詳解]
 
static const struct st_shell_command com_file_dirv
 ドライブのファイルリスト詳細を表示する [詳解]
 
static const struct st_shell_command com_file_delete
 ファイルを削除する [詳解]
 
static const struct st_shell_command com_file_fdump
 ファイルの内容をダンプ表示する [詳解]
 
static const struct st_shell_command com_file_operation
 ファイルをアプリケーションで実行する [詳解]
 
static const struct st_shell_command com_file_batch
 バッチファイルを実行する [詳解]
 
static const struct st_shell_command *const com_file_list []
 
const struct st_shell_command com_file
 ファイル操作 [詳解]
 

詳解

ファイル操作コマンド

日付
2007.07.14
著者
Takashi SHUDO

fileコマンド

file コマンドには以下のサブコマンドがあります。

サブコマンド 機能 詳細
mount デバイスをマウントする com_file_mount
umount デバイスをアンマウントする com_file_umount
free ドライブの空き容量を表示する com_file_diskfree
dir ドライブのファイルリストを表示する com_file_dir
delete ファイルを削除する com_file_delete
fdump ファイルの内容をダンプ表示する com_file_fdump
operation ファイルをアプリケーションで実行する com_file_operation
batch バッチファイルを実行する com_file_batch

com_file.c に定義があります。

変数詳解

◆ com_file

const struct st_shell_command com_file
初期値:
= {
.name = "file",
.manual_str = "File strage operation commands",
.sublist = com_file_list
}

ファイル操作

com_file.c895 行目に定義があります。

◆ com_file_batch

const struct st_shell_command com_file_batch
static
初期値:
= {
.name = "batch",
.command = batch,
.usage_str = "<file_name>"
}

バッチファイルを実行する

com_file.c803 行目に定義があります。

◆ com_file_delete

const struct st_shell_command com_file_delete
static
初期値:
= {
.name = "delete",
.command = delete,
.usage_str = "<file_name>"
}

ファイルを削除する

com_file.c623 行目に定義があります。

◆ com_file_dir

const struct st_shell_command com_file_dir
static
初期値:
= {
.name = "dir",
.command = dir,
.usage_str = "[path]"
}

ドライブのファイルリストを表示する

com_file.c458 行目に定義があります。

◆ com_file_dirv

const struct st_shell_command com_file_dirv
static
初期値:
= {
.name = "dirv",
.command = dirv,
.usage_str = "[path]"
}

ドライブのファイルリスト詳細を表示する

com_file.c538 行目に定義があります。

◆ com_file_diskfree

const struct st_shell_command com_file_diskfree
static
初期値:
= {
.name = "free",
.command = diskfree,
.usage_str = "[drive]"
}

ドライブの空き容量を表示する

com_file.c312 行目に定義があります。

◆ com_file_fdump

const struct st_shell_command com_file_fdump
static
初期値:
= {
.name = "fdump",
.command = fdump,
.usage_str = "<file_name> [start [end]]"
}

ファイルの内容をダンプ表示する

com_file.c655 行目に定義があります。

◆ com_file_list

const struct st_shell_command* const com_file_list[]
static
初期値:
= {
0
}
static const struct st_shell_command com_file_dirv
ドライブのファイルリスト詳細を表示する
Definition: com_file.c:538
static const struct st_shell_command com_file_mount
デバイスをマウントする
Definition: com_file.c:242
static const struct st_shell_command com_file_batch
バッチファイルを実行する
Definition: com_file.c:803
static const struct st_shell_command com_file_fdump
ファイルの内容をダンプ表示する
Definition: com_file.c:655
static const struct st_shell_command com_file_operation
ファイルをアプリケーションで実行する
Definition: com_file.c:772
static const struct st_shell_command com_file_umount
デバイスをアンマウントする
Definition: com_file.c:281
static const struct st_shell_command com_file_delete
ファイルを削除する
Definition: com_file.c:623
static const struct st_shell_command com_file_diskfree
ドライブの空き容量を表示する
Definition: com_file.c:312
static const struct st_shell_command com_file_dir
ドライブのファイルリストを表示する
Definition: com_file.c:458

com_file.c873 行目に定義があります。

◆ com_file_mount

const struct st_shell_command com_file_mount
static
初期値:
= {
.name = "mount",
.command = mount,
.usage_str = "[<drive> <device_name> [fsname]]"
}

デバイスをマウントする

com_file.c242 行目に定義があります。

◆ com_file_operation

const struct st_shell_command com_file_operation
static
初期値:
= {
.name = "operation",
.command = operation,
.usage_str = "<file_name>"
}

ファイルをアプリケーションで実行する

com_file.c772 行目に定義があります。

◆ com_file_umount

const struct st_shell_command com_file_umount
static
初期値:
= {
.name = "umount",
.command = umount,
.usage_str = "<drive>"
}

デバイスをアンマウントする

com_file.c281 行目に定義があります。