The Objective Toolkit file system class provides access to common file system functions, such as reading a directory or copying a file. The class also encapsulates parsing and CStringList methods.
SECFileSystem is a class that allows you to access common file system functions such as retrieving general information about files and directories, reading directories, copying files, and more.
SECFileSystem can help create code for the following tasks. Please see the Objective Toolkit Class Reference or online help for a full list of methods for this class.
Call the CopyFile() method. For example:
SECFileSystem fs; BOOL bRetVal = fs.CopyFile("foo.txt", "a:\\bar.txt"); |
Call the CopyFiles() method. For example:
SECFileSystem fs; BOOL bRetVal = fs.CopyFiles("c:\\foo\\bar\\*.txt", "c:\\foo2"); |
Call the CompareFiles() method. For example:
SECFileSystem fs; BOOL bRetVal = fs.CompareFiles("foo.txt", "bar.txt", 20480); |
Call the DeleteFile() method. For example:
SECFileSystem fs; BOOL bRetVal = fs.DeleteFile("c:\\foo.txt"); |
Call the DeleteFiles() method. For example:
SECFileSystem fs; BOOL bRetVal = fs.DeleteFiles("c:\\foo\\bar\\*.txt"); |
Call one of the following methods:
GetFileAttribute()
GetFileStatus()
GetFileModifyTime()
GetFileAccessTime()
GetFileSize()
For example:
SECFileSystem fs; BOOL bRetVal = fs.GetFileAttribute("c:\\test.txt", bAttr); |
Call one of the following methods:
GetFullPathName()
GetBaseFileName()
GetExtension()
GetFileName()
GetFileSystem()
GetPath()
For example:
SECFileSystem fs; CString strPath; strPath = fs. GetFullPathName("c:\\test\\.\\..\\foo\\bar\\what.txt"); ASSERT(Path == "c:\\foo\\bar\\what.txt"); |
Call the GetDirectory() method. For example:
SECFileSystem fs; CStringList *pDir = fs.GetDirectory("*.txt", SECFileSystem::normal, TRUE); fs.GetDirectory("*.doc", normal, TRUE, pDir); |
Call the MakeDirectory() method. For example:
BOOL bRetVal = fs.MakeDirectory("c:\\foo\\bar"); |
Call the ChangeDirectory() method. For example:
BOOL bRetVal = fs.ChangeDirectory("c:\\foo\\bar"); |
The Objective Toolkit filedemo sample (Samples\Toolkit\MFC\Utility\filedemo) demonstrates the use of the SECFileSystem class. This sample does not ship with the product. For information on how to obtain this sample, see Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.