Commit Graph

102 Commits

Author SHA1 Message Date
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ń
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ń
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ń
3dc332d8c8 Fix std build 2018-05-10 15:14:09 +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ń
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ń
cecc35033a Add write example. 2017-11-08 20:40:36 +01:00
Rafał Harabień
d5c37f2af5 Introduce FsOptions struct for providing options for library.
Old read_only flag in FileSystem::new was misleading.
2017-11-08 20:26:50 +01:00
Rafał Harabień
8a8ee3c51a Ignore volume ID and label if signature is not valid. 2017-11-08 20:03:21 +01:00
Rafał Harabień
5c0ad0ce18 More code refactoring. 2017-11-08 19:59:03 +01:00
Rafał Harabień
681ee56cb3 Keep only BPB in FileSystem struct instead of entire BootRecord. 2017-11-08 19:41:05 +01:00
Rafał Harabień
4366b1836d Add more comments in code. 2017-11-08 16:47:12 +01:00
Rafał Harabień
3f581835db Code refactoring - no functional changes. 2017-11-08 16:03:08 +01:00
Rafał Harabień
3dc524759f WIP dir_entry module? 2017-11-08 14:09:20 +01:00
Rafał Harabień
c4e6d59492 Add set_created and set_accessed public functions in File.
Small code refactoring included.
2017-11-08 01:23:00 +01:00
Rafał Harabień
b38ea78f3e Add automatic update of timestamps (created, accessed, modified).
Works only if chrono feature is enabled (default).
2017-11-08 00:18:31 +01:00
Rafał Harabień
cdde3ca468 When generating short name replace invalid characters with '?'. 2017-11-08 00:07:06 +01:00
Rafał Harabień
1576c4d697 Add file name validation. 2017-11-07 23:17:52 +01:00
Rafał Harabień
288da370b3 Ignore high 16 bits of cluster number in FAT12/16 dir entry. 2017-11-07 22:52:56 +01:00
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ń
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