Commit Graph

218 Commits

Author SHA1 Message Date
Rafał Harabień
de9977e571 Don't panic in Drop.
The same behavior exists (without logging) in BufWriter from std crate.
It's not recommended to depend on flush during drop.
Instead user should flush explicitly and check for error.
2017-11-07 01:13:02 +01:00
Rafał Harabień
4613196733 Catch only NotFound error in create_file and create_dir. 2017-11-07 01:06:52 +01:00
Rafał Harabień
21bd2a0e8d Zero new directory clusters after allocation. 2017-10-27 15:03:54 +02:00
Rafał
9ec23f1234 Add create_dir function. (#5) 2017-10-27 14:12:53 +02:00
Rafał
529d717e30 Add .editorconfig file and fix whitespaces in existing files. (#4) 2017-10-25 17:20:27 +02:00
Rafał Harabień
cffa875d34 Make create-test-img.sh more portable. 2017-10-21 17:38:20 +02:00
Rafał Harabień
9d3780f859 Update README and add more doc comments. 2017-10-21 16:25:04 +02:00
Rafał Harabień
2a61b0d175 Small code improvements. 2017-10-21 15:51:19 +02:00
Rafał
df98ca8779 Create file functionality (#3)
* Support removing files and directories.

* Add create_file functionality.
2017-10-21 15:35:26 +02:00
Rafał Harabień
ba5329edad Support removing files and directories. 2017-10-20 16:18:17 +02:00
Rafał Harabień
b2c3eb1823 Don't recalculate cluster in seek if not needed. 2017-10-15 16:17:41 +02:00
Rafał Harabień
e2374c08cc Fix seek for directory backed file. 2017-10-15 15:56:01 +02:00
Rafał Harabień
da76625759 Replace commented out logging by log crate usage. 2017-10-15 00:55:19 +02:00
Rafał Harabień
ef96f90b0d Add checking for LFN sequence corruption. 2017-10-14 15:24:03 +02:00
Rafał Harabień
b6a3a505ce Add more badges to README. 2017-10-11 00:57:31 +02:00
Rafał Harabień
98ec30589a Add some sanity checks and fix possible issues with partial read when not using read_exact. 2017-10-10 23:19:44 +02:00
Rafał Harabień
d52b0918ca Support FAT mirroring. 2017-10-10 23:18:32 +02:00
Rafał Harabień
0c6e9aec5b Fix multiple corner cases and simplify code. 2017-10-10 16:05:19 +02:00
Rafał Harabień
13dd50bf61 Simplify BufStream implementation and use it in write test. 2017-10-10 14:48:57 +02:00
Rafał Harabień
d8eba51b88 Alloc and free clusters for file data. 2017-10-09 21:14:28 +02:00
Rafał Harabień
f32f1c7279 Basic write support for files.
No cluster management yet.
Also BufStream is broken when writing.
2017-10-09 14:59:52 +02:00
Rafał Harabień
7b967914a6 Exclude test images from packaged crate. 2017-10-07 17:02:22 +02:00
Rafał Harabień
37f52e4024 Fix warnings. 2017-10-07 16:45:11 +02:00
Rafał Harabień
6355db8073 Add tests for open_dir with '.' and '..'. 2017-10-07 16:37:15 +02:00
Rafał Harabień
a974a61cb8 Fix dir entries pointing to root directory.
Fixes 'ls dir/..'.
2017-10-07 16:31:42 +02:00
Rafał Harabień
f850c76a1b Dont panic on unknown file attributes. 2017-10-07 16:25:53 +02:00
Rafał Harabień
d32ae0eef9 Allow seeking beyond end of file as documented in Seek trait.
Also fix possible panic when seeking in file without clusters.
2017-10-07 16:07:33 +02:00
Rafał Harabień
120c9b035c Rename DirReader to DirRawStream. 2017-10-07 15:00:27 +02:00
Rafał Harabień
a1a2ffc2af Remove unneeded Fat prefix for most structures. 2017-10-07 14:56:50 +02:00
Rafał Harabień
beb463ba3f Fix possible panics if cluster chain ends before EOF. 2017-10-07 02:37:29 +02:00
Rafał Harabień
3e08c80fb0 Dont assume cluster iterator always succeeds. 2017-10-07 02:19:19 +02:00
Rafał Harabień
057eef07bb Fix possible deadlock if reading dir entry fails. 2017-10-07 02:16:34 +02:00
Rafał Harabień
d97ab1d1e1 Rename crate to fatfs and add more info to Cargo.toml. 2017-10-06 17:00:38 +02:00
Rafał Harabień
b604b19bde Make chrono crate dependency optional. 2017-10-06 16:42:29 +02:00
Rafał Harabień
a7ca474a2f Add FatDir::iter() method returning dir entries iterator.
FatDir is no longer iterator. Change allows to iterate over directory and still be able to use it.
2017-10-06 16:07:11 +02:00
Rafał Harabień
bfa4984ae3 Use lossy conversion for UTF-8/16 strings instead of panicking. 2017-10-06 15:51:01 +02:00
Rafał Harabień
bc835d59b5 Don't use boxed buffer in FAT cluster reading code.
I assume gived Read object is capable of basic buffering and caching.
2017-10-04 13:56:44 +02:00
Rafał Harabień
94dfe7ffd5 Remove exfat references.
exfat is very different from fat12/16/32 and wont be supported.
2017-10-01 21:39:11 +02:00
Rafał Harabień
f9f192c35e Add FAT table iterator. 2017-10-01 21:31:44 +02:00
Rafał Harabień
d88850624a Remove FatDir::list() method.
Vec can be created by using Iterator trait.
2017-10-01 18:45:58 +02:00
Rafał Harabień
284d26282c Rename some fields in internal bsp struct. 2017-10-01 18:13:59 +02:00
Rafał Harabień
c8ccd7d86e Don't use dynamic allocation for FAT table wrapper.
FAT table still uses Box but its hardly avoidable when reading entire FAT into memory.
2017-09-28 00:11:24 +02:00
Rafał Harabień
5f6f5921c1 Add Travis CI integration. 2017-09-27 14:21:01 +02:00
Rafał Harabień
cb6d486e86 Fix warning. 2017-09-27 14:20:52 +02:00
Rafał Harabień
4feeb3eead Use references instead of Rc for shared state. 2017-09-27 14:05:58 +02:00
Rafał Harabień
840290f754 Add LFN support and rename some functions. 2017-09-24 22:12:38 +02:00
Rafał Harabień
2158c712e1 Add cat and ls examples. 2017-09-24 14:34:23 +02:00
Rafał Harabień
c6ba07848e Rename some functions based on std::fs module. 2017-09-24 14:34:07 +02:00
Rafał Harabień
df2852351b Rename crate to rfat. 2017-09-24 03:13:50 +02:00
Rafał Harabień
6b6759802a Refactoring. 2017-09-24 03:08:00 +02:00