mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
* Feature: Augment VFS file information with creation times & update some console functions to use VFS.
This commit is contained in:
parent
277cdf67b0
commit
948bc43d85
7 changed files with 36 additions and 23 deletions
|
|
@ -530,8 +530,12 @@ DefineEngineFunction(fileSize, S32, ( const char* fileName ),,
|
|||
|
||||
"@ingroup FileSystem")
|
||||
{
|
||||
Con::expandScriptFilename(sgScriptFilenameBuffer, sizeof(sgScriptFilenameBuffer), fileName);
|
||||
return Platform::getFileSize( sgScriptFilenameBuffer );
|
||||
StrongRefPtr<Torque::FS::FileNode> node = Torque::FS::GetFileNode(fileName);
|
||||
if (node.isValid())
|
||||
{
|
||||
return node->getSize();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
DefineEngineFunction( fileModifiedTime, String, ( const char* fileName ),,
|
||||
|
|
@ -609,13 +613,7 @@ DefineEngineFunction(fileDelete, bool, ( const char* path ),,
|
|||
"@return True if file was successfully deleted\n"
|
||||
"@ingroup FileSystem")
|
||||
{
|
||||
static char fileName[1024];
|
||||
static char sandboxFileName[1024];
|
||||
|
||||
Con::expandScriptFilename( fileName, sizeof( fileName ), path );
|
||||
Platform::makeFullPathName(fileName, sandboxFileName, sizeof(sandboxFileName));
|
||||
|
||||
return dFileDelete(sandboxFileName);
|
||||
return Torque::FS::Remove(path);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -830,13 +828,7 @@ DefineEngineFunction( pathCopy, bool, ( const char* fromFile, const char* toFile
|
|||
"@note Only present in a Tools build of Torque.\n"
|
||||
"@ingroup FileSystem")
|
||||
{
|
||||
char qualifiedFromFile[ 2048 ];
|
||||
char qualifiedToFile[ 2048 ];
|
||||
|
||||
Platform::makeFullPathName( fromFile, qualifiedFromFile, sizeof( qualifiedFromFile ) );
|
||||
Platform::makeFullPathName( toFile, qualifiedToFile, sizeof( qualifiedToFile ) );
|
||||
|
||||
return dPathCopy( qualifiedFromFile, qualifiedToFile, noOverwrite );
|
||||
return Torque::FS::CopyFile(fromFile, toFile, noOverwrite);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -876,11 +868,7 @@ DefineEngineFunction( createPath, bool, ( const char* path ),,
|
|||
"@note Only present in a Tools build of Torque.\n"
|
||||
"@ingroup FileSystem" )
|
||||
{
|
||||
static char pathName[1024];
|
||||
|
||||
Con::expandScriptFilename( pathName, sizeof( pathName ), path );
|
||||
|
||||
return Platform::createPath( pathName );
|
||||
return Torque::FS::CreatePath(path);
|
||||
}
|
||||
|
||||
#endif // TORQUE_TOOLS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue