mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-20 11:47:46 +00:00
Create directories if needed for AddData, ExpandData, etc
This commit is contained in:
parent
f340319a9e
commit
db2ea22201
1 changed files with 9 additions and 0 deletions
|
@ -338,6 +338,9 @@ pub fn process_patch(data_dir : &str, path : &str) {
|
||||||
SqpkOperation::AddData(add) => {
|
SqpkOperation::AddData(add) => {
|
||||||
let filename = get_dat_filename(data_dir, add.main_id, add.sub_id, add.file_id);
|
let filename = get_dat_filename(data_dir, add.main_id, add.sub_id, add.file_id);
|
||||||
|
|
||||||
|
let (left, right) = filename.rsplit_once('/').unwrap();
|
||||||
|
fs::create_dir_all(left);
|
||||||
|
|
||||||
let mut new_file = OpenOptions::new()
|
let mut new_file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
|
@ -362,6 +365,9 @@ pub fn process_patch(data_dir : &str, path : &str) {
|
||||||
SqpkOperation::ExpandData(expand) => {
|
SqpkOperation::ExpandData(expand) => {
|
||||||
let filename = get_dat_filename(data_dir, expand.main_id, expand.sub_id, expand.file_id);
|
let filename = get_dat_filename(data_dir, expand.main_id, expand.sub_id, expand.file_id);
|
||||||
|
|
||||||
|
let (left, right) = filename.rsplit_once('/').unwrap();
|
||||||
|
fs::create_dir_all(left);
|
||||||
|
|
||||||
let mut new_file = OpenOptions::new()
|
let mut new_file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
|
@ -381,6 +387,9 @@ pub fn process_patch(data_dir : &str, path : &str) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let (left, right) = file_path.rsplit_once('/').unwrap();
|
||||||
|
fs::create_dir_all(left);
|
||||||
|
|
||||||
let mut new_file = OpenOptions::new()
|
let mut new_file = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
|
|
Loading…
Add table
Reference in a new issue