Jump to content

A small but useful tool

biotoxin
Go to solution Solved by biotoxin,

so there's this nifty utility I've been using for a couple years called "file menu tools" and I'm talking with a dev about this idea how they should totally add this feature and he chimes back "that sounds a lot like this thing we already did" called "unpack folder" turns out I've had the ability for ages and for some reason either forgot about it or didn't notice it before, it's exactly what I wanted, the whole thing all said features auto delete empty folder, right click, auto rename, etc

 

so if you'll excuse my derp

thanks for trying anyway

can't tell you how much I've been looking for this exact feature for the last few weeks seemingly without finding it already online in the particular form I was thinking of

since anything else I came across basically you had to launch it as a stand alone program without using selected folders, you had to navigate because apparently drag and drop was just too much work, etc

 

I just feel so much better now

I'm having a bit of a hard time starting a small project because I'm unfamiliar with actually working within the OS, passing variables etc

before anyone claims what I expect, it's not a homework assignment it's just a small program I want for convenience factor and a little experience

 

the idea is to basically flatten a folder structure, I want to take all files from selected sub folders and move them to the current folder then delete the empty folder

from thinking on it and considering I only know c++ with any confidence outside of scripting languages I've been thinking about what I'd need

 

I think I'd have to use some of the following bits

get_file_name (const string &path, string &f_name)get_dirs(const char* p_name)void move_file(const char *source, const char *dest)

 

basically storing names as strings then probably a compare operation between source and destination before the move

if there's a duplicate I'd rather just let it rename it with a -1 or something

 

I have some vague idea of what to do but not really the know how of how to do it, in particular passing the current user selection from windows to the program so it only does it for the selected folders

a check to make sure the folder is empty before deleting it

 

and that's about as far as I've gotten because I've been trying to read up on it but I don't really even know where to look (specifically) for that either, I have all kinds of links for various resources with no real idea what I'm looking for

any help in this regard would be much appreciated.

Spoiler

CPU: TR3960x enermax 360 AIO Mobo: Aorus Master RAM: 128gb ddr4 trident z royal PSU: Seasonic Prime 1300w GPU: 5700xt, 5500xt, rx590 Case: c700p black edition Display: Asus MG279Q ETC: Living the VM life many accessories as needed Storage: My personal cluster is now over 100tb!

Link to comment
Share on other sites

Link to post
Share on other sites

What Os are you using? It would be very simple to do in Linux and OSX:

mv ./*/* .

This will do exactly what you want, apart from deleting the folders when you are done with them. and you may have to put it in a simple loop depending on the depth of the directory strucuture.

find ./ -type f -exec mv '{}' . \;

similar implementation, but uses the find program.

 

You could download the GNU core utilities for Windows and it would then work on Windows.

Link to comment
Share on other sites

Link to post
Share on other sites

I multiboot between ubuntu, win7x64, win home server 2011 or 2013? barely use that one directly, arch linux, steam os, a live disc of backtrack, 2 different anonymous OS both of which I think are gnome based, and a strange KDE red hat I can't remember the name of

 

as to core utilities, a quick google search comes up with a few results, have any suggestions on most up to date? gnu.org lists curent version as 8.22 and cygwin I think is only up to 8.15?

Spoiler

CPU: TR3960x enermax 360 AIO Mobo: Aorus Master RAM: 128gb ddr4 trident z royal PSU: Seasonic Prime 1300w GPU: 5700xt, 5500xt, rx590 Case: c700p black edition Display: Asus MG279Q ETC: Living the VM life many accessories as needed Storage: My personal cluster is now over 100tb!

Link to comment
Share on other sites

Link to post
Share on other sites

I also neglected to ask how I would bind this to right click functionality, possibly limiting it to only when selecting folders?

I imagine a simple registry key for windows would do it, but wouldn't have a clue for linux

 

and wouldn't both of those options be global (within current folder), as opposed to only selected folders?

Spoiler

CPU: TR3960x enermax 360 AIO Mobo: Aorus Master RAM: 128gb ddr4 trident z royal PSU: Seasonic Prime 1300w GPU: 5700xt, 5500xt, rx590 Case: c700p black edition Display: Asus MG279Q ETC: Living the VM life many accessories as needed Storage: My personal cluster is now over 100tb!

Link to comment
Share on other sites

Link to post
Share on other sites

so there's this nifty utility I've been using for a couple years called "file menu tools" and I'm talking with a dev about this idea how they should totally add this feature and he chimes back "that sounds a lot like this thing we already did" called "unpack folder" turns out I've had the ability for ages and for some reason either forgot about it or didn't notice it before, it's exactly what I wanted, the whole thing all said features auto delete empty folder, right click, auto rename, etc

 

so if you'll excuse my derp

thanks for trying anyway

can't tell you how much I've been looking for this exact feature for the last few weeks seemingly without finding it already online in the particular form I was thinking of

since anything else I came across basically you had to launch it as a stand alone program without using selected folders, you had to navigate because apparently drag and drop was just too much work, etc

 

I just feel so much better now

Spoiler

CPU: TR3960x enermax 360 AIO Mobo: Aorus Master RAM: 128gb ddr4 trident z royal PSU: Seasonic Prime 1300w GPU: 5700xt, 5500xt, rx590 Case: c700p black edition Display: Asus MG279Q ETC: Living the VM life many accessories as needed Storage: My personal cluster is now over 100tb!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×