Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: how copy file on linux? Date: Wed, 26 Jun 2024 15:35:00 -0700 Organization: None to speak of Lines: 16 Message-ID: <87v81vs57v.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 27 Jun 2024 00:35:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2dc86e450632c25820fa91c1ec368267"; logging-data="2469342"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CjX7rSeZHucO2xW8ZE3ML" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:I/mU8oAKiV3S7nEG+FU32x3xX3Y= sha1:aYdUGJSewR5G/6IGUlyu+l07eQc= Xref: csiph.com comp.lang.c:386579 Thiago Adams writes: > How to copy a file on linux keeping the original file information? > timestamp etc? > > Or in other words the equivalent of CopyFileA from windows. comp.unix.programmer is likely to give you better answers. I don't think POSIX defines any functions that copy files. If I uunderstand correctly, you want to do the equivalent of "cp -p", but from C rather than from a shell. You might consider using system(), but that has some drawbacks, and there are probably better ways. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */