[project @ 2003-07-17 15:37:36 by jmb]

move scrap directory

svn path=/import/netsurf/; revision=229
This commit is contained in:
John Mark Bell 2003-07-17 15:37:36 +00:00
parent 5b149ba1d6
commit 59cf6bcb96
2 changed files with 12 additions and 6 deletions

View File

@ -2398,15 +2398,16 @@ void gui_edit_textarea(struct browser_window* bw, struct gui_gadget* g)
{
FILE* file;
xosfile_create_dir("<Wimp$ScrapDir>.NetSurf", 77);
file = fopen("<Wimp$ScrapDir>/NetSurf/TextArea", "w");
xosfile_create_dir("<Wimp$ScrapDir>.WWW", 77);
xosfile_create_dir("<Wimp$ScrapDir>.WWW.NetSurf", 77);
file = fopen("<Wimp$ScrapDir>/WWW/NetSurf/TextArea", "w");
if (g->data.textarea.text != 0)
fprintf(file, "%s", g->data.textarea.text);
fprintf(stderr, "closing file.\n");
fclose(file);
xosfile_set_type("<Wimp$ScrapDir>.NetSurf.TextArea", osfile_TYPE_TEXT);
xos_cli("filer_run <Wimp$ScrapDir>.NetSurf.TextArea");
xosfile_set_type("<Wimp$ScrapDir>.WWW.NetSurf.TextArea", osfile_TYPE_TEXT);
xos_cli("filer_run <Wimp$ScrapDir>.WWW.NetSurf.TextArea");
}
void ro_msg_datasave(wimp_message* block)

View File

@ -230,13 +230,18 @@ void plugin_write_parameters_file(struct object_params *params)
byte pdata[4] = {0, 0, 0, 0};
os_fw *pfile;
int i, j, rsize;
char *tstr;
/* Create the file */
xosfile_create_dir("<Wimp$ScrapDir>.NetSurf", 77);
xosfile_create_dir("<Wimp$ScrapDir>.WWW", 77);
xosfile_create_dir("<Wimp$ScrapDir>.WWW.NetSurf", 77);
/* path + filename + terminating NUL */
params->filename = xcalloc(23+10+1 , sizeof(char));
xos_read_monotonic_time((int*)&time);
sprintf(params->filename, "<Wimp$ScrapDir>.NetSurf.p%7d", (int)time<<8);
tstr = xcalloc(40, sizeof(char));
sprintf(tstr, "%01u", (unsigned int)time<<8);
sprintf(params->filename, "<Wimp$ScrapDir>.WWW.NetSurf.p%1.9s", tstr);
xfree(tstr);
LOG(("filename: %s", params->filename));
xosfind_openoutw(osfind_NO_PATH, params->filename, NULL, &pfile);