From: | Jack York |
Date: | 10 Aug 2001 at 14:33:03 |
Subject: | [amiga-c] Re: How do I copy clone |
Hello Stephen
On 10-Aug-01, Stephen Illingworth wrote:
> Hello Jack
>> How do I copy a file so that all of its attributes are like the original
>> (like the copy clone command but by my own code, not using
>> SystemTagList)?
> After the regular copy routine (I assume you've already done this
> part), you need to explicitely set the attributes yourself.
Yes.
> You do this by grabbing a copy of the source files info block
> (with the Examine() command) and altering just three attributes
> of the target file - the comment, the date and the protection
> flags. There are three functions in the dos.library that allows
> you to do this - SetComment(), SetFileDate() and SetProtection().
Ahh, I wasn't aware of these functions. I was trying to set them directly
and then writing the file.
> void
> setAttributes (STRPTR target_file, struct FileInfoBlock *
> source_file_fib)
> {
> SetProtection (target_file, source_file_fib->fib_Protection);
> SetFileDate (target_file, source_file_fib->fib_Date);
> SetComment (target_file, source_file_fib->fib_Comment);
> }
This works except for SetFileDate. I even tried
struct DateStamp ds;
ds.ds_Days = 300; ds.ds_Hour = 0; ds.ds_Tick = 0;
SetFileDate(target_file, &ds);
But no matter what I do the written file has the current date and time. Any
ideas why this may be failing.
Jack
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Small business owners...
Tell us what you think!
http://us.click.yahoo.com/vO1FAB/txzCAA/ySSFAA/dpFolB/TM
---------------------------------------------------------------------~->
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/