Up: GEOS SDK TechDocs | Up | Prev: FileRename() ... | Next: FileTruncate() ...

FileSetHandleExtAttributes()

word	FileGetPathExtAttributes( /* returns error */
        FileHandle			fh,			/* handle of open file */
        FileExtendedAttribute		 	attr,			/* attribute to get */
        const void			* buffer,			/* attribute is read from here */
        word			bufSize);			/* length of buffer in bytes */

This routine sets one or more extended attributes of an open GEOS file. (To set the attributes of a file without opening it, call FileSetPathExtAttributes() .) If a single attribute is specified, the attribute's new value will be read from the buffer passed. If several attributes are to be changed, attr should be set to FEA_MULTIPLE, and buffer should point to an array of FileExtAttrDesc structures. In this case, bufSize should be the number of structures in the buffer, not the length of the buffer.

If FileSetHandleExtAttributes() is successful, it returns zero. Otherwise, it sets the thread's error value (accessible via ThreadGetError() ) and returns one of the following error codes:

ERROR_ATTR_NOT_SUPPORTED
The file system does not recognize the attribute constant passed.
ERROR_ATTR_SIZE_MISMATCH
The buffer passed was the wrong size for the attribute specified.
ERROR_ACCESS_DENIED
The caller does not have write-access to the file.
ERROR_CANNOT_BE_SET
The extended attribute cannot be changed. Such attributes as FEA_SIZE and FEA_NAME cannot be changed with the FileSet...() routines.

Tips and Tricks: Note that the only way to create or change a custom attribute is by passing FEA_MULTIPLE, and using a FileExtAttrDesc to describe the attribute.

See Also: FileSetPathExtAttributes().

Include: file.h

FileSetPathExtAttributes()

word	FileSetPathExtAttributes(
        const char			* path,			/* path relative to current
						 * working directory */
        FileExtendedAttribute			 attr,			/* attribute to get */
        const void			* buffer,			/* attribute is read from here */
        word			bufSize);			/* length of buffer in bytes */

This routine sets one or more extended attributes of a file. If a single attribute is specified, the attribute will be written in the buffer passed. If several attributes are to be changed, attr should be set to FEA_MULTIPLE and buffer should point to an array of FileExtAttrDesc structures. In this case, bufSize should be the number of structures in the buffer, not the length of the buffer.

If FileSetPathExtAttributes() is successful, it returns zero. Otherwise, it sets the thread's error value (accessible via ThreadGetError() ) and returns one of the following error codes:

ERROR_ATTR_NOT_SUPPORTED
The file system does not recognize the attribute constant passed.
ERROR_ATTR_SIZE_MISMATCH
The buffer passed was the wrong size for the attribute specified.
ERROR_ACCESS_DENIED
FileSetPathExtAttributes() returns this if any geode (including the caller) has the file open with "deny-write" exclusive access, or if the file is not writable.
ERROR_CANNOT_BE_SET
The extended attribute cannot be changed. Such attributes as FEA_SIZE and FEA_NAME cannot be changed with the FileSet...ExtAttributes() routines.

Tips and Tricks: Note that the only way to create or change a custom attribute is by passing FEA_MULTIPLE, and using a FileExtAttrDesc to describe the attribute.

See Also: FileSetHandleExtAttributes().

Include: file.h

FileSetStandardPath()

void	FileSetStandardPath(
        StandardPath path);			/* StandardPath to set */

This routine changes the current working directory to one of the system's StandardPath directories. Pass a standard path.

Include: file.h

FileSize()

dword	FileSize(
        FileHandle fh);		/* handle of open file */

This routine returns the size of the open file specified.

Include: file.h


Up: GEOS SDK TechDocs | Up | Prev: FileRename() ... | Next: FileTruncate() ...