Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
put and read a file (.txt) into PMAC flashmemory
#1
Hi,

i have a aplication on windows 7 that generate a output file in .txt format.
I need that the pmac have acces to this file to read and load global variables with the information.

I try put file using the ftp (http://ftp.192.168.200.1) but i dont have succes.

i create a C aplication into pmac using libraries

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

but i have dude with the path to acces a file. if you can give me a example how to put the path and where is the best place to put the file.

thanks.

int main(void)
{
FILE * fp;
char * line = NULL;
int len = 0;
int read;
struct Data data;
{

};
fp = fopen("test.txt", "r");
if (fp != NULL){
while ((read = getline(&line, &len, fp)) != -1) {
data = getValue(line, read);
}
fclose(fp);
if (line)
free(line);
}
printStructure(&data);
return 0;
}
Reply
#2
If you place the file in the ftp top level directory it should be located in /var/ftp. So pass the full file path to fopen:

fp = fopen("/var/ftp/test.txt", "r");
Reply
#3
(08-02-2018, 02:27 PM)shansen Wrote: If you place the file in the ftp top level directory it should be located in /var/ftp. So pass the full file path to fopen:

fp = fopen("/var/ftp/test.txt", "r");


thanks for your answer.

I try but when i put the file into the ftp folder the system throw the attached problems.

how can i enable and wich is the best folder to put the file?

thanks again


Attached Files Image(s)
           
Reply
#4
I am able to drag a text file into gather or usrflash no problem on multiple PMAC CPU types through ftp in a file explorer like your computer shows. What PMAC form factor is this and can you share the file or try with a dummy text file with just a sentence written?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)