Files manipulation in Ecere

Help with the Ecere cross platform system functionality: working with files, threads, timers, databases, etc.
Post Reply
sacrebleu
Posts: 27
Joined: Sun Jan 17, 2010 12:37 pm

Files manipulation in Ecere

Post by sacrebleu »

Checking if a file exists, loading a text file's contents in a char *, saving a char *'s contents in a text file, loading and saving binary files
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Files manipulation in Ecere

Post by jerome »

Quick answers:

Checking if a file exists: FileExists

Loading a text file's contents in a char *: File f = FileOpen(...);, f.Read() (works just like fread in C)

You can also use other functions in the File class, such as GetLine(), etc.

Saving a char *'s contents in a text file: File f = FileOpen(...);, f.Write() (works just like fwrite in C)
You can also use other functions in the File class, such asPuts, Printf, Print, PrintLn, Putc, etc.

Loading and saving binary files: You should stick to File::Read() and File::Write() for binary.
Post Reply