[Kronos2-developer] [Kronos 2] Virtual mashine for Kronos branch master updated. b3d4ec1c816ccb03b0
Status: Pre-Alpha
Brought to you by:
moskvin
From: Dmitrii K. <sst...@us...> - 2011-06-08 17:06:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Virtual mashine for Kronos". The branch, master has been updated via b3d4ec1c816ccb03b04bb1a6beddf11a22da132c (commit) from b470add54ee5a85a0c26a8d50eced80046163eb8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b3d4ec1c816ccb03b04bb1a6beddf11a22da132c Author: Dmitriy Kuragin <dku...@ya...> Date: Wed Jun 8 23:47:17 2011 +0700 =Last commit is bad diff --git a/src/disks/xd1.dsk b/src/disks/xd1.dsk index cdfc64c..dd4d65f 100644 Binary files a/src/disks/xd1.dsk and b/src/disks/xd1.dsk differ diff --git a/src/vm/src/fs/NTFS.cpp b/src/vm/src/fs/NTFS.cpp index 15a7b76..c0a6f9b 100644 --- a/src/vm/src/fs/NTFS.cpp +++ b/src/vm/src/fs/NTFS.cpp @@ -28,12 +28,14 @@ #include <stdio.h> #include <QHash> +#include <io.h> + #include "NTFS.h" using namespace FS; using namespace Utils; -NTFS::NTFS(void) { +NTFS::NTFS(void):mountPoint((char *)FS_DIR_MOUNT){ //opens = 0; filterDirs = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot; // this->currentDir = NULL; @@ -70,7 +72,7 @@ int NTFS::mount(int handleDevice, const char* point){ logs->warn(QString("mount: Exist mount with the point: %1").arg(point)); //return error; } - return open(FS_DIR_MOUNT); + return open(mountPoint); } int NTFS::unmount(int handleDevice){ @@ -217,7 +219,7 @@ bool NTFS::isdir(unsigned int id){ bool flag = false; File* file = getFile(id); if (file != NULL) { - if (file->fullName.compare(FS_DIR_MOUNT, Qt::CaseInsensitive) == 0) { + if (file->fullName.compare(mountPoint, Qt::CaseInsensitive) == 0) { file->isDir = flag = true; } else { QFileInfo fileInfo(file->fullName); @@ -334,7 +336,7 @@ int NTFS::close(unsigned int id){ void NTFS::clean(void){ // this->files.pop_back(); QString path = ""; - path.append(FS_DIR_MOUNT); + path.append(mountPoint); this->currentTree.setPath(path); } @@ -410,7 +412,7 @@ int NTFS::deviceList(unsigned int handleDevice, StorageDevice* storageDevice) { unsigned long long NTFS::deviceFree(int handleDevice) { // TODO: use node (now use C://) #ifdef _WIN32 - QDir::setCurrent( FS_DIR_MOUNT ); + QDir::setCurrent( mountPoint ); ULARGE_INTEGER free; bool bRes = ::GetDiskFreeSpaceExA( 0 , &free , NULL , NULL ); if ( !bRes ) return 0; @@ -419,8 +421,8 @@ unsigned long long NTFS::deviceFree(int handleDevice) { struct stat stst; struct statfs stfs; - if ( ::stat(FS_DIR_MOUNT,&stst) == -1 ) return 0; - if ( ::statfs(FS_DIR_MOUNT,&stfs) == -1 ) return 0; + if ( ::stat(mountPoint,&stst) == -1 ) return 0; + if ( ::statfs(mountPoint,&stfs) == -1 ) return 0; return stfs.f_bavail * ( stst.st_blksize ); #endif @@ -433,7 +435,7 @@ long long getValue(ULARGE_INTEGER data) { unsigned long long NTFS::deviceUsed(int handleDevice){ // TODO: use node (now use C://) #ifdef _WIN32 - QDir::setCurrent( FS_DIR_MOUNT ); + QDir::setCurrent( mountPoint ); unsigned __int64 total, free; bool bRes = ::GetDiskFreeSpaceExA( 0 , (PULARGE_INTEGER)&free , (PULARGE_INTEGER)&total , NULL ); if ( !bRes ) return 0; @@ -446,8 +448,8 @@ unsigned long long NTFS::deviceUsed(int handleDevice){ struct stat stst; struct statfs stfs; - if ( ::stat(FS_DIR_MOUNT,&stst) == -1 ) return 0; - if ( ::statfs(FS_DIR_MOUNT,&stfs) == -1 ) return 0; + if ( ::stat(mountPoint,&stst) == -1 ) return 0; + if ( ::statfs(mountPoint,&stfs) == -1 ) return 0; return (stfs.f_blocks - stfs.f_bavail) * ( stst.st_blksize ); #endif @@ -497,6 +499,11 @@ int NTFS::link(unsigned int id, const char* fileName){ return error; } +int NTFS::changePoint(const char *point){ + mountPoint[0] = point[strlen(point)-1]; + return 0; +} + int NTFS::unlink(unsigned int id, const char* fileName){ File* file = getFile(id); if (file != NULL) { diff --git a/src/vm/src/fs/NTFS.h b/src/vm/src/fs/NTFS.h index 65ad7ef..07ce689 100644 --- a/src/vm/src/fs/NTFS.h +++ b/src/vm/src/fs/NTFS.h @@ -23,7 +23,6 @@ #include <QList> #include <QString> #include <QDir> - #ifdef _WIN32 #include <windows.h> #else // linux stuff @@ -79,6 +78,7 @@ namespace FS { int create(unsigned int); int link(unsigned int, const char*); int unlink(unsigned int, const char*); + int changePoint(const char*); private: QList<Node*> nodes; @@ -94,5 +94,6 @@ namespace FS { //int opens; QDir::Filters filterDirs; void printMem(byte*); + char *mountPoint; }; } diff --git a/src/vm/src/fs/OperationFS.h b/src/vm/src/fs/OperationFS.h index a934ecf..4187f69 100644 --- a/src/vm/src/fs/OperationFS.h +++ b/src/vm/src/fs/OperationFS.h @@ -52,6 +52,8 @@ namespace FS { DeviceList = 50, DeviceFree = 51, DeviceUsed = 52, + ChangePoint = 53, + ExistPoint = 54, SysLog = 99, }; @@ -182,6 +184,8 @@ namespace FS { virtual int create(unsigned int) = 0; + virtual int changePoint(const char*) = 0; + virtual int link(unsigned int, const char*) = 0; virtual int unlink(unsigned int, const char*) = 0; ----------------------------------------------------------------------- Summary of changes: src/disks/xd1.dsk | Bin 21340160 -> 21340160 bytes src/vm/src/fs/NTFS.cpp | 27 +++++++++++++++++---------- src/vm/src/fs/NTFS.h | 3 ++- src/vm/src/fs/OperationFS.h | 4 ++++ 4 files changed, 23 insertions(+), 11 deletions(-) hooks/post-receive -- Virtual mashine for Kronos |