summaryrefslogtreecommitdiffstats
path: root/src/tools/tqfile_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tqfile_unix.cpp')
-rw-r--r--src/tools/tqfile_unix.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/tools/tqfile_unix.cpp b/src/tools/tqfile_unix.cpp
index a56466cda..96e947f97 100644
--- a/src/tools/tqfile_unix.cpp
+++ b/src/tools/tqfile_unix.cpp
@@ -61,14 +61,14 @@ extern const char* qt_fileerr_read;
bool qt_file_access( const TQString& fn, int t )
{
if ( fn.isEmpty() )
- return FALSE;
+ return false;
return ::access( TQFile::encodeName(fn), t ) == 0;
}
/*!
\overload
Removes the file \a fileName.
- Returns TRUE if successful, otherwise FALSE.
+ Returns true if successful, otherwise false.
*/
bool TQFile::remove( const TQString &fileName )
@@ -77,7 +77,7 @@ bool TQFile::remove( const TQString &fileName )
#if defined(QT_CHECK_NULL)
tqWarning( "TQFile::remove: Empty or null file name" );
#endif
- return FALSE;
+ return false;
}
return unlink( TQFile::encodeName(fileName) ) == 0;
}
@@ -92,7 +92,7 @@ bool TQFile::remove( const TQString &fileName )
/*!
Opens the file specified by the file name currently set, using the
- mode \a m. Returns TRUE if successful, otherwise FALSE.
+ mode \a m. Returns true if successful, otherwise false.
\keyword IO_Raw
\keyword IO_ReadOnly
@@ -170,13 +170,13 @@ bool TQFile::open( int m )
#if defined(QT_CHECK_STATE)
tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif
- return FALSE;
+ return false;
}
if ( fn.isEmpty() ) { // no file name defined
#if defined(QT_CHECK_NULL)
tqWarning( "TQFile::open: No file name specified" );
#endif
- return FALSE;
+ return false;
}
init(); // reset params
setMode( m );
@@ -184,9 +184,9 @@ bool TQFile::open( int m )
#if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File access (%s) not specified", fn.latin1() );
#endif
- return FALSE;
+ return false;
}
- bool ok = TRUE;
+ bool ok = true;
struct stat st;
if ( isRaw() ) {
int oflags = O_RDONLY;
@@ -221,12 +221,12 @@ bool TQFile::open( int m )
if ( fd != -1 ) { // open successful
::fstat( fd, &st ); // get the stat for later usage
} else {
- ok = FALSE;
+ ok = false;
}
} else { // buffered file I/O
TQCString perm;
char perm2[4];
- bool try_create = FALSE;
+ bool try_create = false;
if ( flags() & IO_Append ) { // append to end of file?
setFlags( flags() | IO_WriteOnly ); // append implies write
perm = isReadable() ? "a+" : "a";
@@ -236,7 +236,7 @@ bool TQFile::open( int m )
perm = "w+";
} else {
perm = "r+";
- try_create = TRUE; // try to create if not exists
+ try_create = true; // try to create if not exists
}
} else if ( isReadable() ) {
perm = "r";
@@ -257,7 +257,7 @@ bool TQFile::open( int m )
if ( !fh && try_create ) {
perm2[0] = 'w'; // try "w+" instead of "r+"
- try_create = FALSE;
+ try_create = false;
} else {
break;
}
@@ -265,7 +265,7 @@ bool TQFile::open( int m )
if ( fh ) {
::fstat( fileno(fh), &st ); // get the stat for later usage
} else {
- ok = FALSE;
+ ok = false;
}
}
if ( ok ) {
@@ -311,7 +311,7 @@ bool TQFile::open( int m )
/*!
\overload
Opens a file in the mode \a m using an existing file handle \a f.
- Returns TRUE if successful, otherwise FALSE.
+ Returns true if successful, otherwise false.
Example:
\code
@@ -342,13 +342,13 @@ bool TQFile::open( int m, FILE *f )
#if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif
- return FALSE;
+ return false;
}
init();
setMode( m &~IO_Raw );
setState( IO_Open );
fh = f;
- ext_f = TRUE;
+ ext_f = true;
struct stat st;
::fstat( fileno(fh), &st );
#if defined(QT_LARGEFILE_SUPPORT)
@@ -381,13 +381,13 @@ bool TQFile::open( int m, FILE *f )
resetStatus();
}
}
- return TRUE;
+ return true;
}
/*!
\overload
Opens a file in the mode \a m using an existing file descriptor \a f.
- Returns TRUE if successful, otherwise FALSE.
+ Returns true if successful, otherwise false.
When a TQFile is opened using this function, close() does not actually
close the file.
@@ -410,13 +410,13 @@ bool TQFile::open( int m, int f )
#if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif
- return FALSE;
+ return false;
}
init();
setMode( m |IO_Raw );
setState( IO_Open );
fd = f;
- ext_f = TRUE;
+ ext_f = true;
struct stat st;
::fstat( fd, &st );
#if defined(QT_LARGEFILE_SUPPORT)
@@ -449,7 +449,7 @@ bool TQFile::open( int m, int f )
resetStatus();
}
}
- return TRUE;
+ return true;
}
/*!
@@ -479,8 +479,8 @@ TQIODevice::Offset TQFile::size() const
/*!
\overload
- Sets the file index to \a pos. Returns TRUE if successful;
- otherwise returns FALSE.
+ Sets the file index to \a pos. Returns true if successful;
+ otherwise returns false.
Example:
\code
@@ -506,10 +506,10 @@ bool TQFile::at( Offset pos )
#if defined(QT_CHECK_STATE)
tqWarning( "TQFile::at: File (%s) is not open", fn.latin1() );
#endif
- return FALSE;
+ return false;
}
if ( isSequentialAccess() )
- return FALSE;
+ return false;
bool ok;
if ( isRaw() ) {
off_t l = ::lseek( fd, pos, SEEK_SET );
@@ -712,7 +712,7 @@ int TQFile::handle() const
void TQFile::close()
{
- bool ok = FALSE;
+ bool ok = false;
if ( isOpen() ) { // file is not open
if ( fh ) { // buffered file
if ( ext_f )
@@ -721,7 +721,7 @@ void TQFile::close()
ok = fclose( fh ) != -1;
} else { // raw file
if ( ext_f )
- ok = TRUE; // cannot close
+ ok = true; // cannot close
else
ok = ::close( fd ) != -1;
}