Said Chris Heintzelman on Thu, Aug 01, 2002 at 02:04:00PM -0500,
> Interesting. Could you post a code snippet?
Great idea.
I did some tests and I quickly realized that I was absolutely incorrect.
Furthermore, I don't even know what I was thinking when I posted, since
the kernel totally does the
Interesting. Could you post a code snippet?
>d Doug McLaren on Thu, Aug 01, 2002 at 01:58:52AM -0500,
>
>
>>As others have suggested, basically you'll just do this --
>>
>> open input
>> open output
>> malloc a small buffer (1 KB is good but might be slow, 1 MB might
>> be perfect,
Said Doug McLaren on Thu, Aug 01, 2002 at 01:58:52AM -0500,
> As others have suggested, basically you'll just do this --
>
>open input
>open output
>malloc a small buffer (1 KB is good but might be slow, 1 MB might
> be perfect, depending on free ram, 1 GB is a bit large :)
>
On Tue, Jul 30, 2002 at 06:16:43PM -0500, Alexander Boulgakov wrote:
| Duh. Also, this is open source. Check the sourcecode for cp (you can
| find the source at www.gnu.org).
The source code for cp is likely to just confuse anybody who needs to
ask for code to do a simple copy :) After all, it
On Tue, 30 Jul 2002, Chris Heintzelman wrote:
> Good point, although isn't 1 gig a bit much to malloc?
> > size_t BUFSIZE=1024*1024*1024;
Umm, no. [looking nervously other way]
___
Siglinux mailing list
[EMAIL PROTECTED]
http://www.utacm
Good point, although isn't 1 gig a bit much to malloc?
Alex Winbow wrote:
>>Showoff!
>>
>>
> You wouldn't want to use this to copy anything very big. Also, if
>the file size changes during copying, the extra is not copied.
>
> Would it not be better to allocate a nice, fixed buff
> Showoff!
You wouldn't want to use this to copy anything very big. Also, if
the file size changes during copying, the extra is not copied.
Would it not be better to allocate a nice, fixed buffer size, then
copy the file in chunks right up to the end?
eg,
size_t
Showoff!
Chris Heintzelman wrote:
> try this
>
>
> int copy(const char* srcfn, const char* dstfn)
> {
>struct stat stats;
>unsigned size;
>FILE* srcfd;
>FILE* dstfd;
>int ret;
>char* buf;
>
>ret = stat(srcfn,&stats);
>
>if(ret<0) { printf("Error getting file si
try this
int copy(const char* srcfn, const char* dstfn)
{
struct stat stats;
unsigned size;
FILE* srcfd;
FILE* dstfd;
int ret;
char* buf;
ret = stat(srcfn,&stats);
if(ret<0) { printf("Error getting file size: %s\n",strerror(errno));
return errno; }
size =
Duh. Also, this is open source. Check the sourcecode for cp (you can
find the source at www.gnu.org).
Alex
Alexander Boulgakov wrote:
> Vohra, Yasin wrote:
> > Hello:
> >
> > Is there a function that actually makes a copy of the file in C ?
> > If yes please let me know.
> >
> > T
Vohra, Yasin wrote:
> Hello:
>
> Is there a function that actually makes a copy of the file in C ?
> If yes please let me know.
>
> Thanking you - Yasin
>
>
>
> **
> This email and any files transmitted with it fr
Hello:
Is there a function that actually makes a copy of the file in C ?
If yes please let me know.
Thanking you - Yasin
**
This email and any files transmitted with it from the ElPaso
Corporation are confidentia
12 matches
Mail list logo