| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
QC_File.dox.h
1
3 namespace Qore {
5
9 struct PipeInfo {
11 ReadOnlyFile read;
13 File write;
14};
15}
16
18 namespace Qore {
20
66 class File : public ReadOnlyFile {
67
68 public:
70
85nothing chown(softint uid, softint gid = -1);
86
87 public:
89
105 constructor(*string encoding);
106
107 public:
109
114 copy();
115
116 public:
118
120 destructor();
121
122 public:
124
145 int f_printf(string fmt, ...);
146
147 public:
149
154 int f_printf();
155
156 public:
158
180 int f_vprintf(string fmt, any fmt_args);
181
182 public:
184
189 int f_vprintf();
190
191 public:
193
200 string getCharset();
201
202 public:
204
227 hash getLockInfo();
228
229 public:
231
249nothing getTerminalAttributes(TermIOS termios);
250
251 public:
253
270 TermIOS getTerminalAttributes();
271
272 public:
274
304 int lock(softint type = F_RDLCK, softint start = 0, softint len = 0, softint whence = SEEK_SET);
305
306 public:
308
336nothing lockBlocking(softint type = F_RDLCK, softint start = 0, softint len = 0, softint whence = SEEK_SET);
337
338 public:
340
367 int open(string path, softint flags = O_RDONLY, softint mode = 0666, *string encoding);
368
369 public:
371
403nothing open2(string path, softint flags = O_RDONLY, softint mode = 0666, *string encoding);
404
405 public:
407
427 int print(string data);
428
429 public:
431
452 int printf(string fmt, ...);
453
454 public:
456
461 int printf();
462
463 public:
465
484nothing redirect(Qore::File file);
485
486 public:
488
493nothing setCharset(*string encoding);
494
495 public:
497
534nothing setTerminalAttributes(softint action = TCSANOW, TermIOS termios);
535
536 public:
538
548 int sync();
549
550 public:
552
574 int vprintf(string fmt, any fmt_args);
575
576 public:
578
583 int vprintf();
584
585 public:
587
604 int write(binary data);
605
606 public:
608
628 int write(string data);
629
630 public:
632
649 int writei1(int c);
650
651 public:
653
670 int writei2(int s);
671
672 public:
674
691 int writei2LSB(int s);
692
693 public:
695
712 int writei4(int i);
713
714 public:
716
733 int writei4LSB(int i);
734
735 public:
737
754 int writei8(int i);
755
756 public:
758
775 int writei8LSB(int i);
776
777 public:
779
785 static hash<PipeInfo> getPipe();
786};
787
791
793 const O_ACCMODE = O_ACCMODE;
795 const O_APPEND = O_APPEND;
797 const O_CREAT = O_CREAT;
799 const O_DIRECT = O_DIRECT;
801 const O_DIRECTORY = O_DIRECTORY;
803 const O_EXCL = O_EXCL;
805 const O_NDELAY = O_NDELAY;
807 const O_NOCTTY = O_NOCTTY;
809 const O_NOFOLLOW = O_NOFOLLOW;
811 const O_NONBLOCK = O_NONBLOCK;
813 const O_RDONLY = O_RDONLY;
815 const O_RDWR = O_RDWR;
817 const O_SYNC = O_SYNC;
819 const O_TRUNC = O_TRUNC;
821 const O_WRONLY = O_WRONLY;
823
829
831 const F_RDLCK = F_RDLCK;
833 const F_UNLCK = F_UNLCK;
835 const F_WRLCK = F_WRLCK;
837
841
843 const SEEK_CUR = SEEK_CUR;
845 const SEEK_END = SEEK_END;
847 const SEEK_SET = SEEK_SET;
849}
Qore::File
The File class allows Qore programs to read, write, and create files.
Definition QC_File.dox.h:66
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::sync
int sync()
Flushes the file's buffer to disk.
Qore::File::getTerminalAttributes
TermIOS getTerminalAttributes()
Returns the current terminal attributes for the file as a TermIOS object returned as the return value...
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.
Qore::File::f_printf
int f_printf(string fmt,...)
Writes a formatted string with hard field widths to the file.
Qore::File::f_vprintf
int f_vprintf(string fmt, any fmt_args)
Writes a formatted string with hard field widths to a file, where the second argument is the formatti...
Qore::File::getTerminalAttributes
nothing getTerminalAttributes(TermIOS termios)
Saves the current terminal attributes for the file in the TermIOS object passed; changes the object p...
Qore::File::write
int write(string data)
Writes string data to a file; string data is converted to the File's character encoding if necessary ...
Qore::File::vprintf
int vprintf(string fmt, any fmt_args)
Writes a formatted string with soft field widths to a file, where the second argument is the formatti...
Qore::File::printf
int printf(string fmt,...)
Writes a formatted string with soft field widths to the file.
Qore::File::constructor
constructor(*string encoding)
Creates the File object.
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::File::getCharset
string getCharset()
Returns the character encoding for the File.
Qore::File::writei4LSB
int writei4LSB(int i)
Writes a 4-byte (32 bit) integer to the file in binary little-endian format.
Qore::File::destructor
destructor()
Closes the File if it is open and destroys the File object.
Qore::File::printf
int printf()
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::File::redirect
nothing redirect(Qore::File file)
redirects an existing file to another file
Qore::File::vprintf
int vprintf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
Qore::File::writei2LSB
int writei2LSB(int s)
Writes a 2-byte (16 bit) integer to the file in binary little-endian format.
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::print
int print(string data)
Writes string data to a file; string data is converted to the File's character encoding if necessary ...
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_printf
int f_printf()
This method variant does nothing except return a constant 0; it is only included for backwards-compat...
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::File::writei8LSB
int writei8LSB(int i)
Writes an 8-byte (64 bit) integer to the file in binary little-endian format.
Qore::File::getPipe
static hash< PipeInfo > getPipe()
Returns a hash with read and write files on an internal FIFO pipe.
Qore::File::getLockInfo
hash getLockInfo()
Returns a hash of lock information.
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::File::copy
copy()
Creates a new File object with the same character encoding specification as the original,...
Qore::File::write
int write(binary data)
Writes binary data to a file.
Qore::File::writei1
int writei1(int c)
Writes a 1-byte integer to the file.
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::writei2
int writei2(int s)
Writes a 2-byte (16 bit) integer to the file in binary big-endian format.
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::ReadOnlyFile
The ReadOnlyFile class allows Qore programs to read existing files.
Definition QC_ReadOnlyFile.dox.h:23
Qore::TermIOS
This class allows Qore scripts to get or set terminal settings on UNIX platforms.
Definition QC_TermIOS.dox.h:45
Qore::F_UNLCK
const F_UNLCK
Use for unlocking a lock.
Definition QC_File.dox.h:833
Qore::F_WRLCK
const F_WRLCK
Use for exclusive write locking.
Definition QC_File.dox.h:835
Qore::F_RDLCK
const F_RDLCK
Use for read-only locking.
Definition QC_File.dox.h:831
Qore::O_RDWR
const O_RDWR
Open for reading and writing.
Definition QC_File.dox.h:815
Qore::O_NOCTTY
const O_NOCTTY
don't allocate controlling tty (0 on platforms where this is not available)
Definition QC_File.dox.h:807
Qore::O_RDONLY
const O_RDONLY
Open the file read-only.
Definition QC_File.dox.h:813
Qore::O_WRONLY
const O_WRONLY
Open the file write-only.
Definition QC_File.dox.h:821
Qore::O_NOFOLLOW
const O_NOFOLLOW
don't follow links (0 on platforms where this is not available)
Definition QC_File.dox.h:809
Qore::O_EXCL
const O_EXCL
Raise an error if used with O_CREAT and the file exists.
Definition QC_File.dox.h:803
Qore::O_DIRECTORY
const O_DIRECTORY
must be a directory (0 on platforms where this is not available)
Definition QC_File.dox.h:801
Qore::O_DIRECT
const O_DIRECT
direct disk access hint (0 on platforms where this is not available)
Definition QC_File.dox.h:799
Qore::O_ACCMODE
const O_ACCMODE
Mask for access modes (O_RDONLY|O_WRONLY|O_RDWR)
Definition QC_File.dox.h:793
Qore::O_CREAT
const O_CREAT
Create the file if it doesn't exist.
Definition QC_File.dox.h:797
Qore::O_APPEND
const O_APPEND
Open the file in append mode (append on each write)
Definition QC_File.dox.h:795
Qore::O_SYNC
const O_SYNC
synchronized file update option (0 on platforms where this is not available)
Definition QC_File.dox.h:817
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:811
Qore::O_TRUNC
const O_TRUNC
Truncate the size to zero.
Definition QC_File.dox.h:819
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:805
Qore::SEEK_END
const SEEK_END
Indicates that the offset is from the end of the file.
Definition QC_File.dox.h:845
Qore::SEEK_SET
const SEEK_SET
Indicates that the offset is from the start of the file.
Definition QC_File.dox.h:847
Qore::SEEK_CUR
const SEEK_CUR
Indicates that the offset is from the current position in the file.
Definition QC_File.dox.h:843
Qore::TCSANOW
const TCSANOW
make change immediate
Definition QC_TermIOS.dox.h:472
Qore::type
string type(auto arg)
Returns a string giving the data type of the argument passed; see String Type Constants for the value...
Qore::hash
hash< auto > hash(object obj)
Returns a hash of an object's members.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore
main Qore-language namespace
Definition Pseudo_QC_All.dox.h:3
Qore::PipeInfo
Pipe info hash description.
Definition QC_File.dox.h:9
Qore::PipeInfo::write
File write
Write end of the pipe.
Definition QC_File.dox.h:13
Qore::PipeInfo::read
ReadOnlyFile read
Read end of the pipe.
Definition QC_File.dox.h:11