Local File Handling
Site Map Feedback

Download:

Up DTree Local Picker Recycle ResFile Temp

CLocalPath lets you play with local files and folders easily: use the Current Directory concept effectively or find how many files and folders are in a given folder (and the size of everything in there too) like Windows Explorer Properties.

IsFolderEmptyuseful just before deleting a folder.
FormLongPathNameensure you have the long path name.
FormShortPathNamereturns the old DOS-type path name.
GetExtensionreturns the extension from the given path e.g."some.html" returns "html".
FormatPathMakes relative paths absolute and consistently ends folder paths with a backslash (or not).
SetCurrentDirectoryand SetCurrentDirectory work intelligently (SetCurrentDirectory tells you how far it got).
CreatePathcreates subdirectories if they don't exist.
FlushDriveEmpties Cached data so you can remove Removable Media without losing data.
GetTempFolderfinds the system temporary folder and returns the path.
FindFreeFileNameis useful for creating temporary files: give it a folder and a format and it returns a file-name that it knows doesn't exist in the folder yet.
FileToCStringreads a whole file into a string.
ReportSizeprovides a rounded string such as "128 Bytes", "3.4 kB", "4.5 TB" etc. from a file-size.
CCurrentDirectoryis an RAII class to allow easy changes of directory, safe in the knowledge that the current directory will restored when the object goes out of scope.
CFolderSizerGive it a root folder and it records the sizes of all the files and folders within the root and optionally provides a count of files and folders found. The CFolderSizer creates lots of little CFolderSizer children within itself to represent subdirectories.

At the moment, this file uses CSV, though it really needn't! Removing that dependency is on my to-do list.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


 (1210) Last modified: Thu, 05 Feb 2009 20:06:21 +0000