memcardlib - A memory card library - Files


Summary |  Forums |  Files | 
Notes

Release Name: memcardlib-0.1.2 [Download]

Notes:
memcardlib Version 0.1.2
By: Derek Nedelman
Date Released: August 22, 2002
Home Page: http://www.playstation2-linux.com/projects/memcardlib
-------------------------------------------------------------------------------

About memcardlib:
  The standard memory card interface exposed through Linux ends up being a little 
  cumbersome in real applications. If you want to read or get information about the 
  memory card you end up having to open the device and do ioctl commands on it. If 
  you want to write or delete files you end up having to mount/umount the memory card 
  into some known directory and then perform your file operations. This library 
  collects most of the things you might want to do with a memory card; such as 
  determine the type and read, write, or delete files; and wraps them up into a neat 
  interface, making the whole process of managing memory card files much easier.

Technicals:
  -memcardlib is written in C so that it can be used by either C or C++ developers.
  -All the memcardlib functions are prefixed by "memcardlib_" so that you can clearly
   delineate between your own code the the memcardlib function calls.
  -functions.txt is a rundown of all the public functions provided by memcardlib. 
   This will  help you understand what each function's purpose is, what its 
   parameters are, and what values are returned.
  -main.c contains a simple program demonstrating the use of memcardlib. The program
   has 4 modes of operation: write, read, delete, and stats. They all create or operate 
   on a file on the memory card named memcardlib_test.txt. Needless to say, you need
   to have a memory card in slot 0 for the program to work. To compile this program
   type: make
   A summary of what each mode does follows:
     Command-line           What happens
     ------------           -----------------------------------------------------
     ./main stats	          Prints out the memory card info
     ./main write           Writes (creates) the file memcardlib_test.txt to the memory card
     ./main read            Reads and prints out the memory card file memcardlib_test.txt
     ./main delete          Deletes the memory card file memcardlib_test.txt

Limitations of memcardlib:
  -There is no way to enumerate the files on the memory card
  -Only one "file" may be open on a memory card at any particular time

Contacting me:
  Email: nedelman@netzero.net
  AOL Instant Messenger: SuperNedelman
  Other AOL Instant Messenger: SuperDuperDerek


Changes: 0.1.2 - Release October 8, 2002 -Got rid of all system() calls and replaced with nicer mount, umount, mkdir, and other calls (suggestion by mrbrown). 0.1.1 - Release August 24, 2002 -Changed memcardlib_get_file_pos() to memcardlib_get_pos(). Changed documentation accordingly. -Removed the memcardlib_get_card_free_bytes() function. It was redundant. Use memcardlib_get_card_block_info() instead. -When opening a file in write mode or creating a file, library no longer creates a temp file. The file is created directly on the memory card (suggestion by hjlin) -Changed all instances of "mc01" to "mc10" -Fixed two incorrect calls in main() of the sample program that should have been using the variable 'active_memcard' instead of the hardcoded value '0' 0.1 - Release August 22, 2002 -First release. Support for reading, writing, deleting, and testing the existence of files.