return symlink;
}
-static int ext4fs_find_file1(const char *currpath,
- struct ext2fs_node *currroot,
- struct ext2fs_node **currfound, int *foundtype)
+int ext4fs_find_file1(const char *currpath, struct ext2fs_node *currroot,
+ struct ext2fs_node **currfound, int *foundtype)
{
char fpath[strlen(currpath) + 1];
char *name = fpath;
char *buf, loff_t *actread);
int ext4fs_find_file(const char *path, struct ext2fs_node *rootnode,
struct ext2fs_node **foundnode, int expecttype);
+int ext4fs_find_file1(const char *currpath, struct ext2fs_node *currroot,
+ struct ext2fs_node **currfound, int *foundtype);
int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
struct ext2fs_node **fnode, int *ftype);
int ext4fs_exists(const char *filename)
{
- loff_t file_len;
- int ret;
+ struct ext2fs_node *dirnode = NULL;
+ int filetype;
- ret = ext4fs_open(filename, &file_len);
- return ret == 0;
+ if (!filename)
+ return 0;
+
+ return ext4fs_find_file1(filename, &ext4fs_root->diropen, &dirnode,
+ &filetype);
}
int ext4fs_size(const char *filename, loff_t *size)