Changes between Version 16 and Version 17 of file_system


Ignore:
Timestamp:
Jul 8, 2015, 5:29:42 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v16 v17  
    6969It returns 0 if success /  It returns -1 if failure.
    7070
    71 === int '''_fat_open'''( unsigned int  use_irq , char* pathname ) ===
     71=== int '''_fat_open'''( char* pathname , unsigned int flags ) ===
    7272This function implements the giet_fat_open() system call.
    73 The semantic is similar to the UNIX open() function, but the UNIX flags and access rights are not supported.
    74 If the file does not exist in the specified directory, it is created, and both the Inode-Tree, the Fat-Cache and the FAT region
    75 on device true are updated..
     73The semantic is similar to the UNIX open() function,  but only the O_CREATE
     74and O_RDONLY flags are supported. The UNIX access rights are not supported.
     75If the file does not exist in the specified directory, it is created, and the Inode-Tree,
     76the Fat-Cache and the FAT region on device are updated.
    7677If the specified directory does not exist, an error is returned.
    77 In case of success, It allocates a private file descriptor to the calling task, and the reference count is updated.
    78  * '''use_irq''' : boolean (use descheduling mode if supported by the IOC driver)
     78It allocates a file descriptor to the calling task, for the file identified
     79by "pathname". If several tasks try to open the same file, each task 
     80obtains a private file descriptor and the reference count is updated.
     81A node name (file or directory) cannot be larger than 31 characters.
    7982 * '''pathname''' : define both the specified directory and the file name.
    80 It returns the file descriptor index if success / It returns -1 if failure.
     83 * '''flags''' :  O_CREATE and O_RDONLY can be ored.
     84It returns the file descriptor index if success.
     85It returns a negative value if error:
     86 *   -1  :  "fat not initialised"
     87 *   -2  :  "path to parent not found"
     88 *   -3  :  "one name in path too long"
     89 *   -4  :  "file not found"
     90 *   -5  :  "Cannot update parent directory"
     91 *   -6  :  "Cannot update DATA region"
     92 *   -7  :  "Cannot update FAT region"
     93 *   -8  :  "Cannot update FS_INFO sector"
     94 *   -9  :  "file descriptor array full"
    8195
    8296=== int '''_fat_close'''( unsigned int fd_id  ) ===
     
    8498The semantic is similar to the UNIX "close()" function.
    8599It decrements the inode reference count, and release the fd_id entry in the file descriptors array.
    86 If the reference count is zero, it writes all dirty clusters on block device, and releases the memory allocated to the file_cache.
     100If the reference count is zero, it writes all dirty clusters on block device, and releases the memory allocated to the file_cache:
     101The cache 64-Tree infrastructure (depending on file size) is kept, but all buffers and all buffer descriptors are released.
    87102 * '''fd_id''' : file descriptor index
    88 It returns 0 if success /  It returns -1 if failure.
     103It returns 0 if success. It returns a negative value if error:
     104 *  -1  : "FAT not initialised"
     105 *  -2  : "Illegal file descriptor"
     106 *  -3  : "Cannot update DATA region for closed file"
     107 *  -4  : "Cannot release memory"
    89108
    90109=== int '''_fat_file_info'''( unsigned int fd_id , unsigned int* size , unsigned int* offset ) ===
     
    94113 * '''size''' : pointer on the size (return buffer)
    95114 * '''offset''' : pointer on the offset (return buffer)
    96 It returns 0 if success /  It returns -1 if failure.
     115It returns 0 if success. It returns a negative value if error:
     116 *  -1  : "FAT not initialised"
     117 *  -2  : "Illegal file descriptor"
     118 *  -3  : "File not open"
    97119
    98120=== int '''_fat_read'''( unsigned int fd_id , void* buffer , unsigned int count ) ===