www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/11/08:38:53

Xref: news2.mv.net comp.os.msdos.djgpp:960
From: bradtech AT i-link DOT net (Brad Burgan)
Newsgroups: comp.os.msdos.djgpp
Subject: v2b5
Date: Tue, 06 Feb 1996 15:09:33 GMT
Organization: I-Link Inc
Lines: 41
Message-ID: <4f7qvj$10ca@news.i-link.net>
NNTP-Posting-Host: houston-1-1.i-link.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

// [beginning of file]
//
// NETERR.CC
//

#include <stdio.h>
#include <sys\stat.h>

typedef unsigned long ulong;

int main(int argc, char** argv)
  {
  if (argc != 2)
    {
    printf("\n");
    printf("NETERR - syntax: NETERR (test filename)\n");
    printf("\n");
    printf("Looks for networking error in Windows 95.\n");
    exit(1);
    }

  struct stat sbuf; // for reading file's size.

  if (stat(argv[1], &sbuf) != 0)
    {
    printf("\n");
    printf("There was an error reading the file's size...\n");
    exit(1);
    }

  ulong bufsize = sbuf.st_size;

  printf("\nfilesize = %lu\n", sbuf.st_size);
  }
// [end of file]

this program works for files on my hard drive, but not for a networked
drive.  I heard that this might be a bug with Windows 95, but then why
is my dos file manager (Norton Commander v2) able to read the file's
size when this program cannot?  I don't understand.  Please help.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019