qfile-1.1.3 has been yanked.
Qfile
Crate for accessing a file by path, case insensitive. Automatic detection, create a path with a new file or open an existing file.
Examples
//add_path()
//Constructor for adding a file path.
//After using the write() or read() methods, and if Ok(),
//we get the correct path, which will be used as a cache when we reuse
// the real file path: `./FOLDER/folder/File.txt`
let mut file = add_path;
// we get the saved path right away
file.write.unwrap;
println!;
//output: text_1text_2
use QFilePack;
use File;
// the real file path: `./new_FILE.txt`
let mut file = add_path.file.unwrap;
// Get the file directly
// You can use the function to retrieve data
// in bytes format or use it for any other option
assert_eq!;
Paths syntax
- linux & macos (doesn't work with files with '/', "x/y/z.txt" in the name on macos)
./folder/folder/file.txt
- Windows
.\\folder\\folder\\file.txt
D:\\folder\\folder\\file.txt
Auto Mode
Creates a new path with file. Writes new data to an empty file
Example
let mut file = add_path;
file.write.unwrap;
assert_eq!;
- If the path exists, we work with the file (case insensitive)
The path we specified:
./FLDR/FlDr/file.TXT
real path :./fldr/fldr/file.txt
Result :./fldr/fldr/file.txt
- If the file/path is not found, creates a new path with the file (if initial path exists)
The path we specified:
./fldr/fldr_new/file.txt
real path :./fldr
Result :./fldr/fldr_new/file.txt
- but if the initial path is different case of letters and a new file/folder is specified in the path, then a new path is created with the file
The path we specified:
./FLDR/fldr_new/file.TXT
real path :./fldr
Result :
./fldr
./FLDR/fldr_new/file.TXT