The File concept is an abstraction of the regular operating system
dependent file or directory. It is returned by the File, FTP protocol
handlers and also if the content type is unknown by the HTTP protocol
handler.
The URI of this file. Full path+file name.
$myFile = File.create("file:///home/jon/xfile.txt")
PRINT $myFile@url
file:///home/jon/xfile.txt
The size of this file.
PRINT $myFile.length
1024
Returns the MIME type of the file. If the type is unknown to the system
the "application/octet-stream" is returned.
$myFile = File.create("file:///home/guest/diary.txt")
PRINT $myFile@contentType
text/plain
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML |
|
Label: | contentType |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Returns the MIME type of the file. If the type is unknown to the system
the "application/octet-stream" is returned.
Label: | length |
Type: | Integer |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
The size of this file.
Label: | url |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
The URI of this file. Full path+file name.
Label: | content |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | true |
Returns the content of the file as non escaped (`line1\nline2`) String.
Parameters: |
$pathname : | A pathname string. |
|
Creates a new File concept from the pathname given as parameter.
Returns true if the file denoted by the URL exists and can be read,
false otherwise.
Returns true if the file denoted by the URL exists and the application
can write in it, false otherwise.
Deletes the file or directory denoted by this abstract pathname. If it
is a directory then it must be empty in order to succeed.
Returns true if the file denoted by the URL exists and, false otherwise.
Exceptions: |
fileOperationFailed :
(Error) | If unable to read a file. |
Returns a Series with the content of the file denoted by the abstract
path name. The content is wrapped in the Series respecting the Content
Model.
The system-dependent default name-separator character. This field is
initialized to contain the first character of the value of the system
property file.separator. On UNIX systems the value of this field is '/';
on Win32 systems it is '\'.
If the file denoted by the URL is a directory then returns all the URL's
of the files and directories it contains as a Series. If it is a file
then returns Nil.
Returns true if the file denoted by the URL exists and is a file, false
otherwise.
Returns true if the file denoted by the URL exists and is hidden, false
otherwise.
Parameters: |
$pathname : | A pathname string. |
|
Creates any directory marked by the abstract path name, including any
necessary, but not existent parent directory.
Exceptions: |
fileOperationFailed :
(Error) | If unable to read a file. |
Returns true if this File content has been readed successfully, false
otherwise.
Returns true if the file can be renamed to the given name, false
otherwise.
Parameters: |
$newValue : | Value to be set. |
|
Exceptions: |
fileOperationFailed :
(Error) | If unable to write a file. |
Sets this File content to the specified value.
Sets the file's attribute to the value of the logical parameter true or
false.