Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract to the same dir #12

Closed
Tosyk opened this issue Sep 16, 2018 · 8 comments
Closed

extract to the same dir #12

Tosyk opened this issue Sep 16, 2018 · 8 comments

Comments

@Tosyk
Copy link

Tosyk commented Sep 16, 2018

Is it possible to extract files to the same dir?
I'd like to control files storing with cmd.

@scurest
Copy link
Owner

scurest commented Sep 17, 2018

No, the directory always has to be fresh. You can just extract to a tempdir and then copy the files to wherever right?

@Tosyk
Copy link
Author

Tosyk commented Sep 17, 2018

I meant that I must to create new folders every time when I want to extract/convert anything. Is it possible to prevent this? creating new folder is a sctrict rule? I just don't feel good when tools forces me to spread unwanted folders through my hdd. Possibility to extract anywhere user wants would be a great feature.

@scurest
Copy link
Owner

scurest commented Sep 18, 2018

Yes, it always creates a new folder. This is mainly so there's no question of conflicts with existing files.

@scurest
Copy link
Owner

scurest commented Sep 18, 2018

When you say "same dir", you mean the current working directory?

@Tosyk
Copy link
Author

Tosyk commented Sep 18, 2018

I would rather have a note in a readme file that “any exported files could overwrite existent files with the same name” along with the option to export anywhere I want.

By “same die” I’ve meant same folder of source file. But option “to any specified folder” would be much flexible :)

@scurest
Copy link
Owner

scurest commented Sep 18, 2018

I'm definitely not overwriting anything that's already on the disk. ConsoleTool does that when it extracts, which means extracting models with the same filename is harder. You also can't extract to the same dir as the input files since there can be more than one and they don't have to be in the same directory as each other.

So I still like creating a new directory. It's simple to code, simple to understand, and guaranteed not to clobber anything. You can easily script something to do things differently though, eg. this shell script will extract to the current dir clobbering existing files

tmp=`mktemp -du`
apicula extract $@ -o $tmp
for f in `ls $tmp`; do mv $tmp/$f .; done
rmdir $tmp

@scurest scurest closed this as completed Sep 18, 2018
@Tosyk
Copy link
Author

Tosyk commented Sep 18, 2018

thanks for the script — I have something similar made for cmd. but I found this too much complex (create temp folder, extract resources to it, move resources from temp folder to source folder, remove temp folder) way to do such a simple task as extract a single model (and its textures). it's sad that you decided not to give that option to users.

@ghost
Copy link

ghost commented Nov 21, 2019

Agreed - this is poor design.

scurest added a commit that referenced this issue Feb 10, 2020
Allows overwriting files in the output dir if it already exists.

Fixes #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants