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
#5
(08-17-2018, 12:22 PM)Eric Hotchkiss Wrote: 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?

the Pmac is POWER PMAC CLIPsee P233I-E-01 [4-4050JA0-310-000000] and the text file (.txt) that i tried put was:

start=1;
stop=0;
Reply
#6
I am not able to replicate your problem. Please try using an FTP client like filezilla as windows file explorer as FTP can have some issues.

There is a windows option you can try to see if it helps. Find "internet options" in either the control panel or searching the start menu. Go to the advanced tab and scroll down to "Use passive FTP (for..." and check/uncheck the box. If it doesn't help, just set it back.


Attached Files Image(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)