00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "CeylanLibfatFileSystemManager.h"
00028
00029
00030 #include "CeylanLibfatFile.h"
00031 #include "CeylanLibfatDirectory.h"
00032
00033 #include "CeylanLogPlug.h"
00034 #include "CeylanStringUtils.h"
00035 #include "CeylanOperators.h"
00036 #include "CeylanHolder.h"
00037
00038
00039 #ifdef CEYLAN_USES_CONFIG_H
00040 #include "CeylanConfig.h"
00041 #endif // CEYLAN_USES_CONFIG_H
00042
00043
00044 #if CEYLAN_ARCH_NINTENDO_DS
00045 #include "CeylanConfigForNintendoDS.h"
00046 #endif // CEYLAN_ARCH_NINTENDO_DS
00047
00048
00049
00050
00051
00052 extern "C"
00053 {
00054
00055 #if CEYLAN_ARCH_NINTENDO_DS
00056
00057 #include "fat.h"
00058
00059 #include <fcntl.h>
00060 #include <unistd.h>
00061
00062 #endif // CEYLAN_ARCH_NINTENDO_DS
00063
00064 }
00065
00066
00067
00068 using std::string ;
00069 using std::list ;
00070
00071
00072 using namespace Ceylan::Log ;
00073 using namespace Ceylan::System ;
00074
00075
00076
00077 LibfatFileSystemManager *
00078 LibfatFileSystemManager::_LibfatFileSystemManager = 0 ;
00079
00080
00081 const string LibfatFileSystemManager::RootDirectoryPrefix = "" ;
00082 const Ceylan::Latin1Char LibfatFileSystemManager::Separator = '/' ;
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 bool LibfatFileSystemManager::existsAsEntry( const string & entryPath ) const
00102 {
00103
00104 #if CEYLAN_ARCH_NINTENDO_DS
00105
00106 #ifdef CEYLAN_RUNS_ON_ARM7
00107
00108 throw EntryLookupFailed( "LibfatFileSystemManager::existsAsEntry: "
00109 "not supported on the ARM7 (no libfat available)" ) ;
00110
00111 #else // CEYLAN_RUNS_ON_ARM7
00112
00113
00114
00115 return ( ::stat( entryPath.c_str(), 0 ) == 0 ) ;
00116
00117 #endif // CEYLAN_RUNS_ON_ARM7
00118
00119
00120 #else // CEYLAN_ARCH_NINTENDO_DS
00121
00122 throw EntryLookupFailed( "LibfatFileSystemManager::existsAsEntry: "
00123 "not supported on this platform" ) ;
00124
00125 #endif // CEYLAN_ARCH_NINTENDO_DS
00126
00127 }
00128
00129
00130
00131 void LibfatFileSystemManager::createSymbolicLink(
00132 const string & linkTarget, const string & linkName )
00133 {
00134
00135 throw SymlinkFailed( "LibfatFileSystemManager::createSymbolicLink: "
00136 "never supported with Libfat-based filesystems" ) ;
00137
00138 }
00139
00140
00141
00142 time_t LibfatFileSystemManager::getEntryChangeTime( const string & entryPath )
00143 {
00144
00145 #if CEYLAN_ARCH_NINTENDO_DS
00146
00147 #ifdef CEYLAN_RUNS_ON_ARM7
00148
00149 throw GetChangeTimeFailed( "LibfatFileSystemManager::getEntryChangeTime: "
00150 "not supported on the ARM7 (no libfat available)" ) ;
00151
00152 #else // CEYLAN_RUNS_ON_ARM7
00153
00154
00155 struct stat buf ;
00156
00157 if ( ::stat( entryPath.c_str(), & buf ) == 0 )
00158 return buf.st_ctime ;
00159
00160 throw GetChangeTimeFailed(
00161 "LibfatFileSystemManager::getEntryChangeTime: "
00162 "unable to get last change time for entry '" + entryPath + "': "
00163 + System::explainError() ) ;
00164
00165 #endif // CEYLAN_RUNS_ON_ARM7
00166
00167
00168 #else // CEYLAN_ARCH_NINTENDO_DS
00169
00170 throw GetChangeTimeFailed( "LibfatFileSystemManager::getEntryChangeTime: "
00171 "not supported on this platform" ) ;
00172
00173 #endif // CEYLAN_ARCH_NINTENDO_DS
00174
00175 }
00176
00177
00178
00179
00180
00181
00182
00183 const string & LibfatFileSystemManager::getRootDirectoryPrefix() const
00184 {
00185
00186 return RootDirectoryPrefix ;
00187
00188 }
00189
00190
00191
00192 Ceylan::Latin1Char LibfatFileSystemManager::getSeparator() const
00193 {
00194
00195 return Separator ;
00196
00197 }
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 File & LibfatFileSystemManager::createFile( const string & filename,
00208 OpeningFlag createFlag, PermissionFlag permissionFlag )
00209 {
00210
00211 return LibfatFile::Create( filename, createFlag
00212 ) ;
00213
00214 }
00215
00216
00217
00218 File & LibfatFileSystemManager::openFile( const string & filename,
00219 OpeningFlag openFlag )
00220 {
00221
00222 return LibfatFile::Open( filename, openFlag ) ;
00223
00224 }
00225
00226
00227
00228 bool LibfatFileSystemManager::existsAsFileOrSymbolicLink(
00229 const string & filename ) const
00230 {
00231
00232 #if CEYLAN_ARCH_NINTENDO_DS
00233
00234 #ifdef CEYLAN_RUNS_ON_ARM7
00235
00236 throw FileLookupFailed(
00237 "LibfatFileSystemManager::existsAsFileOrSymbolicLink: "
00238 "not supported on the ARM7 (no libfat available)" ) ;
00239
00240 #else // CEYLAN_RUNS_ON_ARM7
00241
00242
00243
00244 struct stat buf ;
00245
00246
00247 return ( ::stat( filename.c_str(), & buf ) == 0
00248 && ( buf.st_mode & S_IFREG ) ) ;
00249
00250 #endif // CEYLAN_RUNS_ON_ARM7
00251
00252
00253 #else // CEYLAN_ARCH_NINTENDO_DS
00254
00255 throw FileLookupFailed(
00256 "LibfatFileSystemManager::existsAsFileOrSymbolicLink: "
00257 "not supported on this platform" ) ;
00258
00259 #endif // CEYLAN_ARCH_NINTENDO_DS
00260
00261 }
00262
00263
00264
00265 void LibfatFileSystemManager::removeFile( const string & filename )
00266 {
00267
00268 #if CEYLAN_ARCH_NINTENDO_DS
00269
00270 #ifdef CEYLAN_RUNS_ON_ARM7
00271
00272 throw FileRemoveFailed( "LibfatFileSystemManager::removeFile: "
00273 "not supported on the ARM7 (no libfat available)" ) ;
00274
00275 #else // CEYLAN_RUNS_ON_ARM7
00276
00277
00278
00279 if ( ::unlink( filename.c_str() ) != 0 )
00280 throw FileRemoveFailed(
00281 "LibfatFileSystemManager::removeFile failed for '"
00282 + filename + "': " + System::explainError() ) ;
00283
00284 #endif // CEYLAN_RUNS_ON_ARM7
00285
00286
00287 #else // CEYLAN_ARCH_NINTENDO_DS
00288
00289 throw FileRemoveFailed( "LibfatFileSystemManager::removeFile: "
00290 "not supported on this platform" ) ;
00291
00292 #endif // CEYLAN_ARCH_NINTENDO_DS
00293
00294 }
00295
00296
00297
00298 void LibfatFileSystemManager::moveFile( const string & sourceFilename,
00299 const string & targetFilename )
00300 {
00301
00302 #if CEYLAN_ARCH_NINTENDO_DS
00303
00304 #ifdef CEYLAN_RUNS_ON_ARM7
00305
00306 throw FileMoveFailed( "LibfatFileSystemManager::moveFile: "
00307 "not supported on the ARM7 (no libfat available)" ) ;
00308
00309 #else // CEYLAN_RUNS_ON_ARM7
00310
00311
00312
00313 if ( ::rename( sourceFilename.c_str(), targetFilename.c_str() ) == -1 )
00314 throw FileMoveFailed(
00315 "LibfatFileSystemManager::moveFile failed, from '"
00316 + sourceFilename + "' to '" + targetFilename + "': "
00317 + System::explainError() ) ;
00318
00319 #endif // CEYLAN_RUNS_ON_ARM7
00320
00321
00322 #else // CEYLAN_ARCH_NINTENDO_DS
00323
00324 throw FileMoveFailed( "LibfatFileSystemManager::moveFile: "
00325 "not supported on this platform" ) ;
00326
00327 #endif // CEYLAN_ARCH_NINTENDO_DS
00328
00329 }
00330
00331
00332
00333 void LibfatFileSystemManager::copyFile( const string & sourceFilename,
00334 const string & targetFilename )
00335 {
00336
00337 #if CEYLAN_ARCH_NINTENDO_DS
00338
00339 #ifdef CEYLAN_RUNS_ON_ARM7
00340
00341 throw FileCopyFailed( "LibfatFileSystemManager::copyFile: "
00342 "not supported on the ARM7 (no libfat available)" ) ;
00343
00344 #else // CEYLAN_RUNS_ON_ARM7
00345
00346 try
00347 {
00348
00349 Ceylan::Holder<LibfatFile> sourceFile(
00350 LibfatFile::Open( sourceFilename ) ) ;
00351
00352 sourceFile->saveAs( targetFilename ) ;
00353 sourceFile->close() ;
00354
00355
00356
00357 }
00358 catch ( const FileException & e )
00359 {
00360 throw FileCopyFailed(
00361 "LibfatFileSystemManager::copyFile failed when copying '"
00362 + sourceFilename + "' to '" + targetFilename + "': "
00363 + e.toString() ) ;
00364 }
00365
00366 #endif // CEYLAN_RUNS_ON_ARM7
00367
00368
00369 #else // CEYLAN_ARCH_NINTENDO_DS
00370
00371 throw FileCopyFailed( "LibfatFileSystemManager::copyFile: "
00372 "not supported on this platform" ) ;
00373
00374 #endif // CEYLAN_ARCH_NINTENDO_DS
00375
00376 }
00377
00378
00379
00380 Size LibfatFileSystemManager::getSize( const string & filename )
00381 {
00382
00383 #if CEYLAN_ARCH_NINTENDO_DS
00384
00385 #ifdef CEYLAN_RUNS_ON_ARM7
00386
00387 throw FileSizeRequestFailed( "LibfatFileSystemManager::getSize: "
00388 "not supported on the ARM7 (no libfat available)" ) ;
00389
00390 #else // CEYLAN_RUNS_ON_ARM7
00391
00392 struct stat buf ;
00393
00394 if ( ::stat( filename.c_str(), & buf ) == 0 )
00395 return static_cast<Size>( buf.st_size ) ;
00396
00397 throw FileSizeRequestFailed( "LibfatFileSystemManager::getSize: "
00398 "could not stat file '" + filename + "': " + System::explainError() ) ;
00399
00400 #endif // CEYLAN_RUNS_ON_ARM7
00401
00402
00403 #else // CEYLAN_ARCH_NINTENDO_DS
00404
00405 throw FileSizeRequestFailed( "LibfatFileSystemManager::getSize: "
00406 "not supported on this platform" ) ;
00407
00408 #endif // CEYLAN_ARCH_NINTENDO_DS
00409
00410 }
00411
00412
00413
00414 time_t LibfatFileSystemManager::getLastChangeTimeFile( const string & filename )
00415 {
00416
00417 #if CEYLAN_ARCH_NINTENDO_DS
00418
00419 #ifdef CEYLAN_RUNS_ON_ARM7
00420
00421 throw FileLastChangeTimeRequestFailed(
00422 "LibfatFileSystemManager::getLastChangeTimeFile: "
00423 "not supported on the ARM7 (no libfat available)" ) ;
00424
00425 #else // CEYLAN_RUNS_ON_ARM7
00426
00427 struct stat buf ;
00428
00429 if ( ::stat( filename.c_str(), & buf ) == 0 )
00430 return buf.st_ctime ;
00431
00432 throw FileLastChangeTimeRequestFailed(
00433 "LibfatFileSystemManager::getLastChangeTimeFile: "
00434 "could not stat file '" + filename + "': " + System::explainError() ) ;
00435
00436 #endif // CEYLAN_RUNS_ON_ARM7
00437
00438
00439 #else // CEYLAN_ARCH_NINTENDO_DS
00440
00441 throw FileLastChangeTimeRequestFailed(
00442 "LibfatFileSystemManager::getLastChangeTimeFile: "
00443 "not supported on this platform" ) ;
00444
00445 #endif // CEYLAN_ARCH_NINTENDO_DS
00446
00447 }
00448
00449
00450
00451 void LibfatFileSystemManager::touch( const string & filename )
00452 {
00453
00454
00455
00456 throw FileTouchFailed( "LibfatFileSystemManager::touch failed: "
00457 "not supported on libfat-based filesystems" ) ;
00458
00459 }
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470 Directory & LibfatFileSystemManager::createDirectory(
00471 const string & newDirectoryName )
00472 {
00473
00474 return LibfatDirectory::Create( newDirectoryName ) ;
00475
00476 }
00477
00478
00479
00480 Directory & LibfatFileSystemManager::openDirectory(
00481 const string & directoryName )
00482 {
00483
00484 return LibfatDirectory::Open( directoryName ) ;
00485
00486 }
00487
00488
00489
00490 bool LibfatFileSystemManager::existsAsDirectory(
00491 const string & directoryPath ) const
00492 {
00493
00494 #if CEYLAN_ARCH_NINTENDO_DS
00495
00496 #ifdef CEYLAN_RUNS_ON_ARM7
00497
00498 throw DirectoryLookupFailed( "LibfatFileSystemManager::existsAsDirectory: "
00499 "not supported on the ARM7 (no libfat available)" ) ;
00500
00501 #else // CEYLAN_RUNS_ON_ARM7
00502
00503
00504
00505 struct stat buf ;
00506
00507 return ( ::stat( directoryPath.c_str(), & buf ) == 0
00508 && ( buf.st_mode & S_IFDIR ) ) ;
00509
00510 #endif // CEYLAN_RUNS_ON_ARM7
00511
00512
00513 #else // CEYLAN_ARCH_NINTENDO_DS
00514
00515 throw DirectoryLookupFailed( "LibfatFileSystemManager::existsAsDirectory: "
00516 "not supported on this platform" ) ;
00517
00518 #endif // CEYLAN_ARCH_NINTENDO_DS
00519
00520 }
00521
00522
00523
00524 void LibfatFileSystemManager::removeDirectory( const string & directoryPath,
00525 bool recursive )
00526 {
00527
00528 #if CEYLAN_ARCH_NINTENDO_DS
00529
00530 #ifdef CEYLAN_RUNS_ON_ARM7
00531
00532 throw DirectoryRemoveFailed( "LibfatFileSystemManager::removeDirectory: "
00533 "not supported on the ARM7 (no libfat available)" ) ;
00534
00535 #else // CEYLAN_RUNS_ON_ARM7
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545 struct stat buf ;
00546
00547 if ( directoryPath.empty() )
00548 throw DirectoryRemoveFailed(
00549 "LibfatFileSystemManager::removeDirectory: "
00550 "void directory specified" ) ;
00551
00552
00553 string thisPath = directoryPath ;
00554
00555 removeLeadingSeparator( thisPath ) ;
00556
00557
00558 if ( recursive )
00559 {
00560
00561 LibfatDirectory & d = LibfatDirectory::Open( thisPath ) ;
00562
00563 list<string> nodes ;
00564 d.getEntries( nodes ) ;
00565
00566 for ( list<string>::const_iterator it = nodes.begin();
00567 it != nodes.end(); it++ )
00568 {
00569
00570 string newPath = joinPath( thisPath, *it ) ;
00571
00572 if ( ::stat( newPath.c_str(), & buf ) == 0 )
00573 {
00574
00575
00576 if ( buf.st_mode & S_IFREG )
00577 {
00578
00579 if ( ::unlink( newPath.c_str() ) )
00580 throw DirectoryRemoveFailed(
00581 "LibfatFileSystemManager::removeDirectory"
00582 " failed in unlink for '" + newPath + "': "
00583 + System::explainError() ) ;
00584 }
00585 else
00586
00587
00588 if ( buf.st_mode & S_IFDIR )
00589 {
00590
00591 removeDirectory( newPath ) ;
00592 }
00593
00594 }
00595 else
00596 {
00597
00598 throw DirectoryRemoveFailed(
00599 "LibfatFileSystemManager::removeDirectory "
00600 "failed in stat for '" + newPath + "': "
00601 + System::explainError() ) ;
00602 }
00603 }
00604
00605 }
00606
00607
00608 if ( ::unlink( thisPath.c_str() ) )
00609 throw DirectoryRemoveFailed(
00610 "LibfatFileSystemManager::removeDirectory failed for directory '"
00611 + thisPath + "': " + System::explainError() ) ;
00612
00613
00614 #endif // CEYLAN_RUNS_ON_ARM7
00615
00616 #else // CEYLAN_ARCH_NINTENDO_DS
00617
00618 throw DirectoryRemoveFailed( "LibfatFileSystemManager::removeDirectory: "
00619 "not supported on this platform" ) ;
00620
00621 #endif // CEYLAN_ARCH_NINTENDO_DS
00622
00623
00624 }
00625
00626
00627
00628 void LibfatFileSystemManager::moveDirectory(
00629 const string & sourceDirectoryPath, const string & targetDirectoryPath )
00630 {
00631
00632 #if CEYLAN_ARCH_NINTENDO_DS
00633
00634 #ifdef CEYLAN_RUNS_ON_ARM7
00635
00636 throw DirectoryMoveFailed( "LibfatFileSystemManager::moveDirectory: "
00637 "not supported on the ARM7 (no libfat available)" ) ;
00638
00639 #else // CEYLAN_RUNS_ON_ARM7
00640
00641
00642
00643
00644 try
00645 {
00646
00647 copyDirectory( sourceDirectoryPath, targetDirectoryPath ) ;
00648 removeDirectory( sourceDirectoryPath ) ;
00649
00650 }
00651 catch( const DirectoryException & e )
00652 {
00653
00654 throw DirectoryMoveFailed(
00655 "LibfatFileSystemManager::moveDirectory failed: "
00656 + e.toString() ) ;
00657
00658 }
00659
00660 #endif // CEYLAN_RUNS_ON_ARM7
00661
00662 #else // CEYLAN_ARCH_NINTENDO_DS
00663
00664 throw DirectoryMoveFailed( "LibfatFileSystemManager::moveDirectory: "
00665 "not supported on this platform" ) ;
00666
00667 #endif // CEYLAN_ARCH_NINTENDO_DS
00668
00669 }
00670
00671
00672
00673 void LibfatFileSystemManager::copyDirectory( const string & sourceDirectoryPath,
00674 const string & targetDirectoryPath )
00675 {
00676
00677 throw DirectoryCopyFailed( "LibfatFileSystemManager::copyDirectory: "
00678 "not supported on this platform." ) ;
00679
00680 }
00681
00682
00683
00684 time_t LibfatFileSystemManager::getLastChangeTimeDirectory(
00685 const string & directoryPath )
00686 {
00687
00688 #if CEYLAN_ARCH_NINTENDO_DS
00689
00690 #ifdef CEYLAN_RUNS_ON_ARM7
00691
00692 throw DirectoryLastChangeTimeRequestFailed(
00693 "LibfatFileSystemManager::getLastChangeTimeDirectory: "
00694 "not supported on the ARM7 (no libfat available)" ) ;
00695
00696 #else // CEYLAN_RUNS_ON_ARM7
00697
00698 struct stat buf ;
00699
00700 if ( ::stat( directoryPath.c_str(), & buf ) == 0 )
00701 return buf.st_ctime ;
00702
00703 throw DirectoryLastChangeTimeRequestFailed(
00704 "LibfatFileSystemManager::getLastChangeTimeDirectory: "
00705 "could not stat directory '" + directoryPath + "': "
00706 + System::explainError() ) ;
00707
00708 #endif // CEYLAN_RUNS_ON_ARM7
00709
00710
00711 #else // CEYLAN_ARCH_NINTENDO_DS
00712
00713 throw DirectoryLastChangeTimeRequestFailed(
00714 "LibfatFileSystemManager::getLastChangeTimeDirectory: "
00715 "not supported on this platform" ) ;
00716
00717 #endif // CEYLAN_ARCH_NINTENDO_DS
00718
00719 }
00720
00721
00722
00723 bool LibfatFileSystemManager::isAValidDirectoryPath(
00724 const string & directoryString )
00725 {
00726
00727
00728 return true ;
00729
00730 }
00731
00732
00733
00734 bool LibfatFileSystemManager::isAbsolutePath( const string & path )
00735 {
00736
00737 return ( path[0] == Separator ) ;
00738
00739 }
00740
00741
00742
00743 std::string LibfatFileSystemManager::getCurrentWorkingDirectoryPath()
00744 {
00745
00746 return _currentWorkingDirectory ;
00747
00748 }
00749
00750
00751
00752 void LibfatFileSystemManager::changeWorkingDirectory(
00753 const string & newWorkingDirectory )
00754 {
00755
00756 #if CEYLAN_ARCH_NINTENDO_DS
00757
00758
00759 #ifdef CEYLAN_RUNS_ON_ARM7
00760
00761 throw DirectoryChangeFailed(
00762 "LibfatFileSystemManager::changeWorkingDirectory: "
00763 "not supported on the ARM7 (no libfat available)" ) ;
00764
00765 #else // CEYLAN_RUNS_ON_ARM7
00766
00767 if ( ::chdir( newWorkingDirectory.c_str() ) != 0 )
00768 throw DirectoryChangeFailed(
00769 "LibfatFileSystemManager::changeWorkingDirectory: "
00770 "unable to change current working directory to '"
00771 + newWorkingDirectory + "': " + explainError() ) ;
00772
00773 _currentWorkingDirectory = newWorkingDirectory ;
00774
00775 #endif // CEYLAN_RUNS_ON_ARM7
00776
00777
00778 #else // CEYLAN_ARCH_NINTENDO_DS
00779
00780 throw DirectoryChangeFailed(
00781 "LibfatFileSystemManager::changeWorkingDirectory: "
00782 "not supported on this platform" ) ;
00783
00784 #endif // CEYLAN_ARCH_NINTENDO_DS
00785
00786 }
00787
00788
00789
00790
00791
00792
00793
00794 const string LibfatFileSystemManager::toString( Ceylan::VerbosityLevels level )
00795 const
00796 {
00797
00798 return "Libfat filesystem manager whose current working directory is '"
00799 + _currentWorkingDirectory + "'" ;
00800
00801 }
00802
00803
00804
00805
00806
00807
00808
00809
00810 LibfatFileSystemManager & LibfatFileSystemManager::GetLibfatFileSystemManager()
00811 {
00812
00813 if ( _LibfatFileSystemManager == 0 )
00814 _LibfatFileSystemManager = new LibfatFileSystemManager() ;
00815
00816 return *_LibfatFileSystemManager ;
00817
00818 }
00819
00820
00821
00822 void LibfatFileSystemManager::SecureLibfatFileSystemManager()
00823 {
00824
00825 if ( _LibfatFileSystemManager == 0 )
00826 _LibfatFileSystemManager = new LibfatFileSystemManager() ;
00827
00828 }
00829
00830
00831
00832 void LibfatFileSystemManager::RemoveLibfatFileSystemManager()
00833 {
00834
00835 if ( _LibfatFileSystemManager != 0 )
00836 {
00837
00838 if ( FileSystemManager::_CurrentDefaultFileSystemManager ==
00839 _LibfatFileSystemManager )
00840 _LibfatFileSystemManager = 0 ;
00841
00842 delete _LibfatFileSystemManager ;
00843 _LibfatFileSystemManager = 0 ;
00844
00845
00846 }
00847
00848 }
00849
00850
00851
00852
00853 LibfatFileSystemManager::LibfatFileSystemManager() :
00854 _currentWorkingDirectory( Ceylan::toString( Separator ) )
00855 {
00856
00857 #if CEYLAN_ARCH_NINTENDO_DS
00858
00859 #ifdef CEYLAN_RUNS_ON_ARM7
00860
00861 throw LibfatFileSystemManagerException(
00862 "LibfatFileSystemManager constructor: not supported on the ARM7" ) ;
00863
00864 #else // CEYLAN_RUNS_ON_ARM7
00865
00866
00867
00868 System::atomicSleep() ;
00869 System::atomicSleep() ;
00870
00871 if ( ::fatInit( 8,
00872 true ) == false )
00873 throw LibfatFileSystemManagerException(
00874 "LibfatFileSystemManager constructor: initialization failed" ) ;
00875
00876 #endif // CEYLAN_RUNS_ON_ARM7
00877
00878
00879 #else // CEYLAN_ARCH_NINTENDO_DS
00880
00881 throw LibfatFileSystemManagerException(
00882 "LibfatFileSystemManager constructor: "
00883 "not supported on this platform" ) ;
00884
00885 #endif // CEYLAN_ARCH_NINTENDO_DS
00886
00887 }
00888
00889
00890
00891 LibfatFileSystemManager::~LibfatFileSystemManager() throw()
00892 {
00893
00894 if ( _LibfatFileSystemManager == this )
00895 _LibfatFileSystemManager = 0 ;
00896
00897
00898
00899 }
00900