volexport() problems

Discuss PocketC for Palm OS (including Desktop Edition)

Postby exit_head on Tue Sep 13, 2005 7:03 am

ok ive checked my directorys and the exist, and ive imported the file but i cant seam to export it.

<code>
//natesVFS
int VOL,ret,ret2,dataname;

main(){
clear();
enumvols(1,&VOL);
puts(VOL+"\n");
ret=volimport(VOL,"/Palm/Programs/DZEEET/temp.pdb",&dataname);
if(ret!=0)alert("import didnt work");
ret2=volexport(VOL,"temp","/Palm/Programs/DZEEET/temp");
if(ret2!=0)alert("export didnt work");
wait();
}
</code>

any ideas?
exit_head
 
Posts: 64
Joined: Tue May 04, 2004 3:50 am
Location: USA

Postby exit_head on Wed Sep 14, 2005 1:54 am

ok i fugured it out, here what i used

//natesVFS
int VOL,ret,ret2,tick;
string dataname;

main(){
clear();
//if VFStemp.pdb doesnt exist create it
if(!dbopen("VFStemp"))dbcreate("VFStemp");
dbclose();
//get the volume id
enumvols(1,&VOL);
puts(VOL+"\n");
//i use the ticks() function to time this to give me an idea of speed
tick=ticks();
//exports the file VFStemp to /PALM/Launcher/
ret2=volexport(VOL,"VFStemp","/PALM/Launcher/VFStemp.pdb");
//if no errors get rid of it on the internal, so we can import it later
if(ret2==0){
dbopen("VFStemp");
dbdelete();
}
tick=ticks()-tick;
if(ret2==0)puts("time pasted exporting: "+tick+"\n");
else(puts("VFSerror!\n"));
//timing this one too!
tick=ticks();
//imports the file VFStemp from /PALM/Launcher/
ret=volimport(VOL,"/PALM/Launcher/VFStemp.pdb",&dataname);
//if we imported sucessfully, delete the copy on the card
if(ret==0)voldelete(VOL,"/PALM/Launcher/DZEEET.prc");
tick=ticks()-tick;
if(ret==0)puts("time pasted importing: "+tick+"\n");
else(puts("VFSerror!\n"));
wait();
}
exit_head
 
Posts: 64
Joined: Tue May 04, 2004 3:50 am
Location: USA


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 5 guests

cron