Commit Graph

135 Commits

Author SHA1 Message Date
Rafał Harabień
5574c2af73 Simplify examples using new FileSystem struct definition 2018-06-13 23:26:13 +02:00
Rafał Harabień
217b6046f1 Make disk object type generic (breaking change)
This change allows for moving an object ownership to FileSystem object
instead of borrowing it. It makes usage of library easier in some cases.
Unfortunately it is a breaking change.
2018-06-13 23:24:08 +02:00
Rafał Harabień
b1894a435e Add FAT reading tests 2018-06-12 01:16:35 +02:00
Rafał Harabień
2304b13ec4 Take immutable self reference in Dir methods
Dir methods do not change Dir object itself. They usually clone inner
stream so no change really happens self struct. Underlying partition is
modified but it does not have to affect API. For example see
std::fs::File::set_len. This change greatly simplifies rename API usage.
2018-06-12 00:07:30 +02:00
Rafał Harabień
4f6ed94cb3 Limit file size to 4GB when writting 2018-06-09 19:32:15 +02:00
Rafał Harabień
18b9d8c285 Do not panic if unexpected file type is found during path traversal
For example if in the middle of the path a file is found.
Return error in such case instead of panicking.
2018-06-07 23:26:11 +02:00
Rafał Harabień
632a371b0d Improve code structure 2018-06-07 23:07:52 +02:00
Rafał Harabień
ccb205c906 Ignore free_cluster_count in FSInfo sector if volume has dirty flag 2018-06-07 22:54:35 +02:00
Rafał Harabień
1656540eac Simplify code by using Self in return type 2018-06-06 17:16:32 +02:00
Rafał Harabień
75a6c32360 Add derived traits for FsStatusFlags and add Eq for some structs 2018-06-06 14:29:38 +02:00
Rafał Harabień
85c48d6aec Make FsStatusFlags struct fields non-public and add getters
This way new fields can be added later without losing backward compatibility.
2018-06-06 14:17:05 +02:00
Rafał Harabień
0b5b04aca6 Make FileSystemStats struct fields non-public and add getters
This way new fields can be added later without losing backward compatibility.
2018-06-06 14:01:19 +02:00
Rafał Harabień
66c976bc3b Add method for renaming/moving a file 2018-06-06 13:56:59 +02:00
Rafał Harabień
21b51af6d5 Fix nostd build 2018-06-04 22:41:38 +02:00
Rafał Harabień
808d58dff7 Update Travis config and set 1.24 as minimal supported rustc version 2018-06-04 22:35:15 +02:00
Rafał Harabień
242e650626 Reduce number of pub(crate) attributes 2018-06-03 16:44:12 +02:00
Rafał Harabień
be0d969f7b Remove ReadSeek and ReadWriteSeek traits duplicated definition 2018-06-03 16:29:44 +02:00
Rafał Harabień
3d29f66aba Avoid using unwrap() in examples
New examples require Rust 1.26 because of returning error from main() function.
2018-05-31 21:40:40 +02:00
Rafał Harabień
a83115dd45 Update FSInfo sector by default (if it is dirty) 2018-05-31 21:39:17 +02:00
Rafał Harabień
9f5f070955 Allow opening files/dirs using short name 2018-05-31 00:23:32 +02:00
Rafał Harabień
7355ac462c Make short name generation more compatible to WinNT 2018-05-31 00:17:01 +02:00
Rafał Harabień
b53882a2ad Fix detection of short name collisions for very short names 2018-05-31 00:11:18 +02:00
Rafał Harabień
0b22cfa0b3 Avoid building short name when traversing path 2018-05-30 17:54:03 +02:00
Rafał Harabień
282c40fad2 Implement proper short-name generation 2018-05-30 17:43:18 +02:00
Rafał Harabień
7c5541c2a9 Add test for lowercase SFN (short LFN encoded in SFN) 2018-05-30 01:39:34 +02:00
Rafał Harabień
d455540707 Add more unit tests 2018-05-30 01:33:01 +02:00
Rafał Harabień
0e96b05054 Add support for LFN encoding in SFN entries on WinNT
New Windows does not create LFN entries if name fits in 8.3 format and
letters in both basename and ext parts are all uppercase or all lowercase.
This commit fixes handling of lowercase letters.
2018-05-30 01:17:24 +02:00
Rafał Harabień
b4be13823c Cache free clusters count 2018-05-28 00:03:42 +02:00
Rafał Harabień
945612f042 Do not write FSInfo sector if nothing changed. 2018-05-27 23:56:38 +02:00
Rafał Harabień
147b31fdcd Update FSInfo sector on unmount/drop 2018-05-27 23:48:38 +02:00
Rafał Harabień
908ab61ee5 Update number of free clusters when allocating and freeing 2018-05-27 23:31:40 +02:00
Rafał Harabień
380add131d Simplify code by using while and if let constructions 2018-05-27 18:37:33 +02:00
Rafał Harabień
a760b4b6d0 Fix cluster leak when truncating files 2018-05-27 18:04:45 +02:00
Rafał Harabień
7709f5e6f6 Add FileSystem::stats method
It allows to get number of total and free clusters on FAT volume.
2018-05-26 17:09:13 +02:00
Rafał Harabień
6230fe91f9 Do not ignore 2 last clusters when allocating 2018-05-26 17:02:36 +02:00
Rafał Harabień
9129816893 Speed up allocation by tracking last allocated cluster 2018-05-26 14:36:38 +02:00
Rafał Harabień
1ecc9293a2 Add example for accessing disk partition 2018-05-17 18:31:33 +02:00
Rafał Harabień
d094fd5d1d Support checking entire FAT table when hint points in the middle of it 2018-05-12 23:38:56 +02:00
Rafał Harabień
4793d20977 Read FSInfo sector on mount and use it during cluster allocation 2018-05-12 23:17:45 +02:00
Rafał Harabień
0e6b0a07a4 Add Cargo.lock to .gitignore
Recommended by Rust docs: https://doc.rust-lang.org/cargo/faq.html
2018-05-10 16:34:21 +02:00
Rafał Harabień
3dc332d8c8 Fix std build 2018-05-10 15:14:09 +02:00
Rafał Harabień
26972b9458 Update README 2018-05-10 15:05:44 +02:00
Rafał Harabień
35d03daae9 Support no_std without alloc 2018-05-10 15:00:59 +02:00
Rafał Harabień
11b2a3b956 Basic no_std support 2018-05-10 01:00:24 +02:00
Rafał Harabień
73c6e9a461 Fix compilation without chromo 2018-05-09 22:58:05 +02:00
Rafał Harabień
429864a69f Clarify that seeked filesystem is not handled by library 2018-05-09 15:34:41 +02:00
Rafał Harabień
3c52f35f6d Update dependencies 2018-05-09 15:34:05 +02:00
Rafał Harabień
e9dec65318 Fix warnings in Rust 1.25 2018-05-09 15:34:00 +02:00
Rafał Harabień
8bb24994e0 Add read_status_flags API for getting dirty and IO error volume flags. 2017-12-01 17:24:02 +01:00
Rafał Harabień
2318bd0c5c Version 0.2. 2017-11-08 23:03:47 +01:00