#include <iostream>
struct Base {
unsigned long a, b, c, d;
};
struct Derived: public Base {
unsigned long e, f;
};
Type: Posts; User: rohan_ak1
#include <iostream>
struct Base {
unsigned long a, b, c, d;
};
struct Derived: public Base {
unsigned long e, f;
};
In my shared library, I have
struct Base
{
/* 4 unsigned long members are there here */
}
struct Derived : public Base
Hello,
My project contains a 1) shared library 2)executable containing a static library
The shared library has an interface used by the static library and takes as input a pointer to a base...
Hello,
I have a module as shown below:
void FreeMemory(void *mem)
{
delete mem;
How would I identify sparse files through a C program ?I know that for a sparse file, its real size would be less than that returned by stat(). How would I get the real size ?
Thanks
Hi All,
I am trying to traverse directories using the undocumented API NtQueryDirectoryFile() to compare its performance against FindFirstFile/FindNextFile
I have written this program:
...
err = FindNextStreamW(file, &stream);
here stream is declared in the same function
void FindAllStreams(HANDLE file)
WIN32_FIND_STREAM_DATA stream;
Hello All,
I am using FindFirstStreamW() and FindNextStreamW() to iterate over all file streams and get the name and size.
However, it returns on the data stream and alternate data streams and...
However, the BackupRead() API would also get me the stream information.
Thanks....
How can I get them separately ?Will the API GetFileAttributes() get these for me ?
Hello All,
If a file is opened using the FILE_FLAG_NO_BUFFERING flag for un-buffered I/O with CreateFile() API, it cannot be backed up using BackupRead().
With un-buffered I/O how can I then...
Hi all,
I need to include array bounds checking in the programs i write.
With strings i use the following for bounds checking :
char s[100];
scanf("%100s",s);
How could I...
i am still in the process of learning C, so just tried that. I know its pointless.
Thanks for the answer :) I tried
printf("%d\n",sizeof(FILE));
and got 148.
Hello everyone,
While learning C File I/O I tried the following code :
#include<stdio.h>
int main()
{
Hello everyone,
I need to change attributes of a file through a C program.I got file attributes using the stat structure.Now I need to set these attributes.What API's should I use?
Thank you
Yes we have discuddes about mmap earlier...However I thought of trying it out just to see if it is any better as I needed to implement fast file copy.Now I think I will stick onto read/write.
I changed the code to this :
#define BSIZE 1048576
.......................
if((fps = open(source, O_RDONLY)) == -1)
printf("error : can't open source file for reading\n");
if((fpd...
Hello everyone,
I tried using mmap to copy very large files in the following way :
if((fps = open(source, O_RDONLY)) == -1)
printf("error : can't open source file for reading\n");...
Hello,
I am trying to use the tar command in a shell script to create an archive of files.The filenames are stored in another file.The file names are seperated by a whitespace and each...
I tried using O_BINARY flag but it gives an error.I guess open() opens a file directly in binary mode.
These are my open() calls for the source and destination :
fps=open(source,O_RDONLY);...
Thanks for all the help :)
I have checked file sizes on fedora 8 for both source and destination directories.I checked every file-size and it is the same.But the total file size is 0.1MB less.
On changing the code to :
while(filesize)
{
if(filesize>BSIZE)
{
blocksize = BSIZE;
}
else
I have now set the buffer size to 1MB and removed the unwanted bzero statements...but what should I do with the problem of improper copying of binary files ( they are broken).