资源简介
本代码使 Android 系统能够自动挂载 NTFS 与 exFAT 格式的 SD 卡和 U 盘,并且都支持读写操作。
本代码需要修改 Android 平台源代码。使用的是 CyanogenMod 10.1 的源代码,并在 Samsung GT-I9100 上测试通过。
具体编译说明请参考 http://http://blog.csdn.net/hackpascal/article/details/8850688
代码片段和文件信息
/*
main.c (01.09.09)
FUSE-based exFAT implementation. Requires FUSE 2.6 or later.
Copyright (C) 2010-2013 Andrew Nayenko
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation either version 3 of the License or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not see .
*/
#define FUSE_USE_VERSION 26
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define exfat_debug(format ...)
#if !defined(FUSE_VERSION) || (FUSE_VERSION < 26)
#error FUSE 2.6 or later is required
#endif
const char* default_options = “ro_fallbackallow_otherblkdevbig_writes“
“defer_permissions“;
struct exfat ef;
static struct exfat_node* get_node(const struct fuse_file_info* fi)
{
return (struct exfat_node*) (size_t) fi->fh;
}
static void set_node(struct fuse_file_info* fi struct exfat_node* node)
{
fi->fh = (uint64_t) (size_t) node;
}
static int fuse_exfat_getattr(const char* path struct stat* stbuf)
{
struct exfat_node* node;
int rc;
exfat_debug(“[%s] %s“ __func__ path);
rc = exfat_lookup(&ef &node path);
if (rc != 0)
return rc;
exfat_stat(&ef node stbuf);
exfat_put_node(&ef node);
return 0;
}
static int fuse_exfat_truncate(const char* path s64 size)
{
struct exfat_node* node;
int rc;
exfat_debug(“[%s] %s %“PRId64 __func__ path size);
rc = exfat_lookup(&ef &node path);
if (rc != 0)
return rc;
rc = exfat_truncate(&ef node size true);
exfat_put_node(&ef node);
return rc;
}
static int fuse_exfat_readdir(const char* path void* buffer
fuse_fill_dir_t filler s64 offset struct fuse_file_info* fi)
{
struct exfat_node* parent;
struct exfat_node* node;
struct exfat_iterator it;
int rc;
char name[EXFAT_NAME_MAX + 1];
exfat_debug(“[%s] %s“ __func__ path);
rc = exfat_lookup(&ef &parent path);
if (rc != 0)
return rc;
if (!(parent->flags & EXFAT_ATTRIB_DIR))
{
exfat_put_node(&ef parent);
exfat_error(“‘%s‘ is not a directory (0x%x)“ path parent->flags);
return -ENOTDIR;
}
filler(buffer “.“ NULL 0);
filler(buffer “..“ NULL 0);
rc = exfat_opendir(&ef parent &it);
if (rc != 0)
{
exfat_put_node(&ef parent);
exfat_error(“failed to open directory ‘%s‘“ path);
return rc;
}
while ((node = exfat_readdir(&ef &it)))
{
exfat_get_name(node name EXFAT_NAME_MAX);
exfat_debug(“[%s] %s: %s %“PRId64“ bytes cluster 0x%x“ __fun 相关资源
- AndroidStudio版直连sqlserver
- android带百分比进度条的文件上传,使
- 美食天下项目Android版源码和Web版源码
- Android之自定义ToggleButton使用
- Android非常漂亮的登录界面
- pc与android通过usb socket实现手机通信
- android毕业设计
- 百度地图自定义Markerandroid
- Android分区工具包
- android-support-v4.jar已打包进去源代码
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- android 视频播放器 项目和原码
- Android【动画】【特效】 17种动画特效
- 基于Android智能家居详细设计(经典)
- android通过JDBC连接Mysql数据库
- Android通讯录的源代码
- android 瀑布流Demo
- 指纹传感器FPC1080在android下的驱动
- delphi xe5 android 调用照相机摄像头拍照
- Android手机连连看游戏源码
- android-sdk-windows v2.3离线完整版
- android 底部弹出菜单(带透明背景)
- Android工程模式简介.rar
- Android蓝牙和Cors网络开发源码
- Android powermanger wakelock
- Android v7的一些jar包
- 最新android supportV7包
- android图片压缩工具类分享
- 单机搭建Android(解决Network is unreach
川公网安备 51152502000135号
评论
共有 条评论