Thanks Handoko
This could come in handy
I'm writing program that should help me creating reports for my employer
. I want to be able to get info about how many files and folders I have on different levels of depth of path
So for example I have sth like this:
C:\35\123\0\1\2 where:
35 is number of State Archive
123 is number of Collection in that archive
0 is continuation number of Collection in that archive
1 is series number
2 is a signature (don't know if its correct english word for this) of Collection (it contains files of scanned documents)
There can be multiple signatures in multiple series in ... etc
I've managed to get the file counts on different depth levels of path and now I'm trying to get i.e number of series in specific collection or number of signatures in specific serie etc.
This will save me a lot of trouble, well atleast if I finish this app
Well, this is a kind of string manipulation game.
Depends on the logic you use, you may need to use these functions:
- RPos
- PathDelim
- AppendPathDelim
- ChompPathDelim
- RightStr
- LeftStr
I recently writing code that has similar problem like yours. I found the code in the link below which after learning how it works, I now have better understanding how to 'jump' between different depth of the folder.
https://wiki.freepascal.org/paszlib#Zipping_a_whole_directory_tree_storing_only_a_relative_path