Qore Programming Language Reference Manual: lib/QC_File.dox.h Source File

Qore Programming Language Reference Manual 0.8.11

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups Pages
QC_File.dox.h
1 namespace Qore {
4
50 class File : public ReadOnlyFile {
51
52 public:
54
69 nothing chown(softint uid, softint gid = -1);
70
71 public:
73
89 constructor(*string encoding);
90
91 public:
93
98 copy();
99
100 public:
102
104 destructor();
105
106 public:
108
129 int f_printf(string fmt, ...);
130
131 public:
133
138 int f_printf();
139
140 public:
142
164 int f_vprintf(string fmt, any fmt_args);
165
166 public:
168
173 int f_vprintf();
174
175 public:
177
184 string getCharset();
185
186 public:
188
210 hash getLockInfo();
211
212 public:
214
232 nothing getTerminalAttributes(TermIOS termios);
233
234 public:
236
253 TermIOS getTerminalAttributes();
254
255 public:
257
287 int lock(softint type = F_RDLCK, softint start = 0, softint len = 0, softint whence = SEEK_SET);
288
289 public:
291
319 nothing lockBlocking(softint type = F_RDLCK, softint start = 0, softint len = 0, softint whence = SEEK_SET);
320
321 public:
323
350 int open(string path, softint flags = O_RDONLY, softint mode = 0666, *string encoding);
351
352 public:
354
386 nothing open2(string path, softint flags = O_RDONLY, softint mode = 0666, *string encoding);
387
388 public:
390
410 int print(string data);
411
412 public:
414
435 int printf(string fmt, ...);
436
437 public:
439
444 int printf();
445
446 public:
448
453 nothing setCharset(*string encoding);
454
455 public:
457
490 nothing setTerminalAttributes(softint action = TCSANOW, TermIOS termios);
491
492 public:
494
504 int sync();
505
506 public:
508
530 int vprintf(string fmt, any fmt_args);
531
532 public:
534
539 int vprintf();
540
541 public:
543
560 int write(binary data);
561
562 public:
564
584 int write(string data);
585
586 public:
588
605 int writei1(int c);
606
607 public:
609
626 int writei2(int s);
627
628 public:
630
647 int writei2LSB(int s);
648
649 public:
651
668 int writei4(int i);
669
670 public:
672
689 int writei4LSB(int i);
690
691 public:
693
710 int writei8(int i);
711
712 public:
714
731 int writei8LSB(int i);
732
733 public:
735
754 static hash hlstat(string path);
755
756 public:
758
777 static hash hstat(string path);
778
779 public:
781
801 static list lstat(string path);
802
803 public:
805
824 static list stat(string path);
825
826 public:
828
847 static hash statvfs(string path);
848 };
853
855 const O_ACCMODE = O_ACCMODE;
857 const O_APPEND = O_APPEND;
859 const O_CREAT = O_CREAT;
861 const O_DIRECT = O_DIRECT;
863 const O_DIRECTORY = O_DIRECTORY;
865 const O_EXCL = O_EXCL;
867 const O_NDELAY = O_NDELAY;
869 const O_NOCTTY = O_NOCTTY;
871 const O_NOFOLLOW = O_NOFOLLOW;
873 const O_NONBLOCK = O_NONBLOCK;
875 const O_RDONLY = O_RDONLY;
877 const O_RDWR = O_RDWR;
879 const O_SYNC = O_SYNC;
881 const O_TRUNC = O_TRUNC;
883 const O_WRONLY = O_WRONLY;
885
891
893 const F_RDLCK = F_RDLCK;
895 const F_UNLCK = F_UNLCK;
897 const F_WRLCK = F_WRLCK;
899
903
905 const SEEK_CUR = SEEK_CUR;
907 const SEEK_END = SEEK_END;
909 const SEEK_SET = SEEK_SET;
911 };
Qore::File::getTerminalAttributes
TermIOS getTerminalAttributes()
Returns the current terminal attributes for the file as a TermIOS object returned as the return value...
Qore::File::writei2LSB
int writei2LSB(int s)
Writes a 2-byte (16 bit) integer to the file in binary little-endian format.
Qore::File::lstat
static list lstat(string path)
Returns a Stat List about the given path's status (does not follow symbolic links) or throws an excep...
Qore::TCSANOW
const TCSANOW
make change immediate
Definition: QC_TermIOS.dox.h:469
Qore::O_EXCL
const O_EXCL
Raise an error if used with O_CREAT and the file exists.
Definition: QC_File.dox.h:865
Qore::File::constructor
constructor(*string encoding)
Creates the File object.
Qore::File::copy
copy()
Creates a new File object with the same character encoding specification as the original, otherwise no other information is copied.
Qore::File::getLockInfo
hash getLockInfo()
Returns a hash of lock information.
Qore::F_UNLCK
const F_UNLCK
Use for unlocking a lock.
Definition: QC_File.dox.h:895
Qore::ReadOnlyFile::hstat
hash hstat()
Returns a Stat Hash about the file's status or throws an exception if any errors occur.
Qore::File::chown
nothing chown(softint uid, softint gid=-1)
Changes the user and group owners of the file on the filesystem (if the current user has sufficient p...
Qore::File::writei8
int writei8(int i)
Writes an 8-byte (64 bit) integer to the file in binary big-endian format.
Qore::File::f_vprintf
int f_vprintf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
Qore::File::lockBlocking
nothing lockBlocking(softint type=F_RDLCK, softint start=0, softint len=0, softint whence=SEEK_SET)
Attempts to lock the file according to the arguments passed, blocking.
Qore::O_RDWR
const O_RDWR
Open for reading and writing.
Definition: QC_File.dox.h:877
Qore::File::vprintf
int vprintf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
Qore::File::writei4
int writei4(int i)
Writes a 4-byte (32 bit) integer to the file in binary big-endian format.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore::O_NOFOLLOW
const O_NOFOLLOW
don't follow links (0 on platforms where this is not available)
Definition: QC_File.dox.h:871
Qore::SEEK_CUR
const SEEK_CUR
Indicates that the offset is from the current position in the file.
Definition: QC_File.dox.h:905
Qore::File::writei1
int writei1(int c)
Writes a 1-byte integer to the file.
Qore::O_DIRECTORY
const O_DIRECTORY
must be a directory (0 on platforms where this is not available)
Definition: QC_File.dox.h:863
Qore::list
list list(...)
Returns a list of the arguments passed at the top level.
Qore::O_DIRECT
const O_DIRECT
direct disk access hint (0 on platforms where this is not available)
Definition: QC_File.dox.h:861
Qore::O_APPEND
const O_APPEND
Open the file in append mode (append on each write)
Definition: QC_File.dox.h:857
Qore::File::sync
int sync()
Flushes the file's buffer to disk.
Qore::ReadOnlyFile::statvfs
hash statvfs()
Returns a Filesystem Status Hash about the file's filesystem status or throws an exception if any err...
Qore::File::f_printf
int f_printf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
Qore::File::printf
int printf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
Qore::O_NONBLOCK
const O_NONBLOCK
non-blocking I/O (untested with Qore; 0 on platforms where this is not available) ...
Definition: QC_File.dox.h:873
Qore::O_ACCMODE
const O_ACCMODE
Mask for access modes (O_RDONLY|O_WRONLY|O_RDWR)
Definition: QC_File.dox.h:855
Qore::File::writei8LSB
int writei8LSB(int i)
Writes an 8-byte (64 bit) integer to the file in binary little-endian format.
Qore::F_RDLCK
const F_RDLCK
Use for read-only locking.
Definition: QC_File.dox.h:893
Qore::type
string type(any arg)
Returns a string giving the data type of the argument passed; see String Type Constants for the value...
Qore::File::open2
nothing open2(string path, softint flags=O_RDONLY, softint mode=0666, *string encoding)
Opens a file in a particular mode; throws an exception on failure.
Qore::ReadOnlyFile::stat
list stat()
Returns a Stat List about the file's status or throws an exception if any errors occur.
Qore::File::hlstat
static hash hlstat(string path)
Returns a Stat Hash about the file's status (does not follow symbolic links) or throws an exception i...
Qore::O_CREAT
const O_CREAT
Create the file if it doesn't exist.
Definition: QC_File.dox.h:859
Qore::SEEK_END
const SEEK_END
Indicates that the offset is from the end of the file.
Definition: QC_File.dox.h:907
Qore::File::write
int write(binary data)
Writes binary data to a file.
Qore::O_NOCTTY
const O_NOCTTY
don't allocate controlling tty (0 on platforms where this is not available)
Definition: QC_File.dox.h:869
Qore::File::destructor
destructor()
Closes the File if it is open and destroys the File object.
Qore::F_WRLCK
const F_WRLCK
Use for exclusive write locking.
Definition: QC_File.dox.h:897
Qore::File::lock
int lock(softint type=F_RDLCK, softint start=0, softint len=0, softint whence=SEEK_SET)
Attempts to lock the file according to the arguments passed, does not block.
Qore::File::writei2
int writei2(int s)
Writes a 2-byte (16 bit) integer to the file in binary big-endian format.
Qore::O_NDELAY
const O_NDELAY
synonym for O_NONBLOCK (untested with Qore; 0 on platforms where this is not available) ...
Definition: QC_File.dox.h:867
Qore::File::getCharset
string getCharset()
Returns the character encoding for the File.
Qore::File::print
int print(string data)
Writes string data to a file; string data is converted to the File's character encoding if necessary ...
Qore::O_WRONLY
const O_WRONLY
Open the file write-only.
Definition: QC_File.dox.h:883
Qore::O_SYNC
const O_SYNC
synchronized file update option (0 on platforms where this is not available)
Definition: QC_File.dox.h:879
Qore::File::writei4LSB
int writei4LSB(int i)
Writes a 4-byte (32 bit) integer to the file in binary little-endian format.
Qore::O_RDONLY
const O_RDONLY
Open the file read-only.
Definition: QC_File.dox.h:875
Qore::File
The File class allows Qore programs to read, write, and create files.
Definition: QC_File.dox.h:50
Qore::File::setTerminalAttributes
nothing setTerminalAttributes(softint action=TCSANOW, TermIOS termios)
Sets the current terminal attributes for the File from the TermIOS object passed; does not change the...
Qore::SEEK_SET
const SEEK_SET
Indicates that the offset is from the start of the file.
Definition: QC_File.dox.h:909
Qore::TermIOS
This class allows Qore scripts to get or set terminal settings on UNIX platforms. ...
Definition: QC_TermIOS.dox.h:44
Qore::O_TRUNC
const O_TRUNC
Truncate the size to zero.
Definition: QC_File.dox.h:881
Qore::hash
hash hash(object obj)
Returns a hash of an object's members.
Qore::ReadOnlyFile
The ReadOnlyFile class allows Qore programs to read existing files.
Definition: QC_ReadOnlyFile.dox.h:18
Qore::File::setCharset
nothing setCharset(*string encoding)
Sets the character encoding for the file; if called with no argument, the default encoding is set...
Qore::File::open
int open(string path, softint flags=O_RDONLY, softint mode=0666, *string encoding)
Opens a File in a particular mode, returns an error code on failure.