Hello,
After having learning docs, it works well.
In my project I’d like
- put a file from XMEM to xD-part FAT
- to modify this FAT file while it’s available on the web
// Cl�ment A. Stage DUT GEII RENNES - FRANCE -
#class auto
#define TCPCONFIG 1
#define USE_RABBITWEB 1
#define FAT_USE_FORWARDSLASH
#define FAT_BLOCK
#use "fat.lib"
#use "dcrtcp.lib"
#use "http.lib"
#memmap xmem
#ximport "pages\index.html" index_html
SSPEC_MIMETABLE_START
SSPEC_MIME(".html","text/html"),
SSPEC_MIMETABLE_END
SSPEC_RESOURCETABLE_START
SSPEC_RESOURCE_XMEMFILE("/", index_html),
SSPEC_RESOURCE_XMEMFILE("/index.html", index_html),
SSPEC_RESOURCETABLE_END
int i ;
#web i;
FATfile mon_fic ;
void main()
{
long prealloc;
int rc;
char contenu_fic[128];
fat_part *part_xD ;
prealloc=0;
part_xD=NULL;
fat_AutoMount(FDDF_USE_DEFAULT);
part_xD = fat_part_mounted[4];
fat_Open(part_xD, "coucou.txt", FAT_FILE, FAT_CREATE, &mon_fic, &prealloc) ;
fat_Write(&mon_fic,"---essai---", 15);
fat_Close(&mon_fic);
fat_Open(part_xD,"coucou.txt",FAT_FILE, 0, &mon_fic, NULL);
fat_Read(&mon_fic, contenu_fic, 128);
printf("Contenu fichier : [%s]", contenu_fic);
sock_init();
http_init();
tcp_reserveport(80);
sspec_fatregister(0, part_xD);
while(1)
{
http_handler();
}
}