Difference between file and URL

Chipp Walters chipp at chipp.com
Sun Dec 5 16:54:09 EST 2004


Hi John,

I agree with Ken.

Try this: (assuming your file is text and not binary)

--> PUT THE FILEPATH INTO A VAR
put "C:/testfile.txt" into tFilePath

--> THIS PUTS THE CONTENTS OF THE FILE INTO A VAR
put URL ("file:" & tFilePath) into tTextVariable

-->DO STUFF TO tTextVariable
put return & "another line" after tTextVariable

--> THIS WRITES THE VAR OUT TO THE ORIG FILE
put tTextVariable into URL ("file:" & tFilePath)

that should do what you want...

best,

Chipp

John Rule wrote:
> I am discovering that open/write/close to a file can be a problem if the
> original file size is larger than the new data size...it simply overwrites
> data in the file, leaving the extra data in tact. Using 'put into URL' does
> not do this (it overwrites the entire file). Is this correct behavior, or a
> bug?


More information about the use-livecode mailing list