什么最容易地进入区块一级的批号系统? 我不关心档案,也不关心原封,我不得不在某个时候读一下财务处。 是否有这样做的简单方法(在C中)? 或者说,我能看一看什么来源? 我发现,这个网络上没有任何可观的教导,我很谨慎,无法深入到煤炭来源,了解如何做。
• 从外部3个档案系统读出的区块?
原标题:Read blocks from an ext3 filesystem?
最佳回答
是的,见e2fsprogs。 这为你提供了工具,能够用Ex2、Ex3和Ex4档案系统做任何事情(!)。 它还设有图书馆接口,以便你能够做任何其他事情。
See the included debugfs, it may be sufficient for You tostart. 否则,检查负责人并撰写一些法典。
问题回答
If you want a simple app then I suggest you can take a look at "dd" utility. I comes as part of GNU Core Utility. Its source is available for download. Take a look at its home page, here.
If you want to achieve same from a C code, then please refer to following code. Hope this helps you. :)
#include <stdio.h>
#include <linux/fs.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define SECTOR_NO 10 /*read 10th sector*/
int main()
{
int sector_size;
char *buf;
int n = SECTOR_NO;
int fd = open("/dev/sda1", O_RDONLY|O_NONBLOCK);
ioctl(fd, BLKSSZGET, §or_size);
printf("%d
", sector_size);
lseek(fd, n*sector_size, SEEK_SET);
buf = malloc(sector_size);
read(fd, buf, sector_size);
return 0;
}
弃置装置及其内部的分门别类,就像你从(和书写)读到的普通档案一样,例如:
head -c 2048 /dev/sda1 > first_2048_bytes
当然,你们需要扎根。
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding