Object for manipulation files.
Returns the total number of bad blocks on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns the block size for the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns the total number of blocks on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns TRUE if the specified device is bootable.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns the total number of bytes on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Creates an empty File object.
#include <cybiko.h> ... struct File file; ... File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { // Performs IO operations. ... } ... File_dtor( &file, LEAVE_MEMORY ); ...
Extended version of the File_ctor function.
Creates a File object and initializes it, using the specified file's parameters.
#include <cybiko.h> ... struct File file; ... File_ctor( &file, "share_data.txt" ); if( File_is_free( &file ) ) { // Performs IO operations. ... } ... File_dtor( &file, LEAVE_MEMORY ); ...
Destructor.
#include <cybiko.h> ... struct File file; ... File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { // Performs IO operations. ... } ... File_dtor( &file, LEAVE_MEMORY ); ...
Checks whether a file with specified name exists.
#include <cybiko.h> ... if( File_exists( "save.dat" ) ) { // Load unfinished game. ... } ... if( game_finished ) { File_remove( "save.dat" ); } ...
Returns the total number of files on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns the number of free blocks on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Estimates the number of free bytes on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Estimates the number of free bytes for user data on the specified device.
#include <cybiko.h> ... TRACE( "------Flash Info---------" ); TRACE( "Bytes total on your device : %ld ", File_bytes_total( "" ) ); TRACE( "Block size : %ld ", File_block_size( "" ) ); TRACE( "Blocks total on your device : %ld ", File_blocks_total( "" ) ); TRACE( "Free blocks total on your device : %ld ", File_free_blocks_total( "" ) ); TRACE( "Bad blocks total on your device : %ld ", File_bad_blocks_total( "" ) ); TRACE( "Free bytes total on your device : %ld ", File_free_bytes_total( "" ) ); TRACE( "Free bytes for user needs on your device : %ld ", File_free_user_bytes_total( "" ) ); TRACE( "File number on your device : %ld ", File_files_total( "" ) ); TRACE( "Device is %s ", File_bootable("") ? "bootable" : "not bootable" ); ...
Returns the time the file was last modified.
#include <cybiko.h> ... struct File file; struct Time file_time; ... { File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { Time_decode( &file_time, File_get_date( &file ) ); TRACE("Date of modification is %d.%d.%d", file_time.month, file_time.day, file_time.year + 1990 ); } ... File_dtor( &file, LEAVE_MEMORY ); } ...
Initializes the File object's fields (name, date, length) of the File object, using the specified file's parameters.
#include <cybiko.h> ... struct File file; ... File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { // Performs IO operations. ... } ... File_dtor( &file, LEAVE_MEMORY ); ...
Checks whether a file is open for IO functions.
#include <cybiko.h> ... struct File file; ... File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { // Performs IO operations. ... } ... File_dtor( &file, LEAVE_MEMORY ); ...
Returns TRUE if the specified string is valid as a filename.
#include <cybiko.h> ... char* input_new_file_name(); ... if( File_is_valid_name( input_new_file_name() ) ) { // Creating new file. ... } ...
Deletes the specified file if it is not being modified (written to or read).
#include <cybiko.h> ... if( File_exists( "save.dat" ) ) { // Loads unfinished game. ... } ... if( game_finished ) { File_remove( "save.dat" ); } ...
Renames the specified file if it is not being modified (written to or read).
#include <cybiko.h> ... if( File_exists( "last_game.sav" ) ) { File_rename( "last_game.sav", "prev_game.sav" ); } ...
Sets date the file was last modified.
#include <cybiko.h> ... struct File file; ... File_ctor( &file ); if( File_get_info( &file, "share_data.txt" ) && File_is_free( &file ) ) { // Performs IO operations. ... // Updates the date of the last modifications. File_set_date( &file, time() ); } ... File_dtor( &file, LEAVE_MEMORY ); ...
Time of the last modification.
File name.
File size.