A signed int can contain up to 2Gig, 2 147 483 648, to be exact.
Since The Mars rovers landed, I have been storing the
photographs in two directories, Spirit and Opportunity. I had
more than 18 000 files in a single directory. Without being
aware of it, I crossed the 2 147 483 648 border last week.
Nothing happens, if you do not attempt to read all files in the directory,
or even worst, copy them to another drive.
Worried by mysterious disk errors, I tried to save my work. When making
the copy however, there was an error when the copy arrived at an image
and could not read it.
Foolish me, I tried to copy the file again.
That was it: the disk started to make a periodic mechanical noise, and
it was GONE ALONG WITH ALL MY DATA IN THE DISK!!!!!!!!!!!!!!!!!!!!!
Why?
When a signed integer is increased beyond 2147483648, it becomes NEGATIVE.
This means that the system will issue a NONSENSE movemevent order to the
read heads, destroying the disk instantly.
I was lucky. I had a full backup of the mars data in my linux system. Ahh
Microsoft.
I fired up the linux machine running ext2 file system. I issued the order to
copy
the files, and started doing other things during the copy.
When the amount of data transmitted arrived at approx 2GB, I heared with
horror that
the disk started doing the SAME repeating mechanical noise and my linux
system
WAS GONE, I HAVE LOST several months of work without any means of getting
my data back.
Signed integer can contain up to 2147483648 bytes. Not a single byte more.
I have developed a compile time switch to check for overflows within
lcc-win32 and
posted here a message, several weeks ago. Nobody cared to answer.
SHIT !!!!!!!!!!!
C is a nice language in which to write file systems. But IT WOULD BE BETTER
TO
BE CAREFUL WITH THOSE "int" s OK?
You do not believe me?
Try it. Make several directories with several thousand files of 100-200K
each, until
you get more than 2GB.
But backup your drive first...
jacob 2 1155 ja***@jacob.remcomp.fr (jacob navia) writes: A signed int can contain up to 2Gig, 2 147 483 648, to be exact.
[snip]
Did you mean to post this twice?
Followups redirected to /dev/null; please reply to the original post,
so we don't get two distinct threads.
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
jacob navia wrote: A signed int can contain up to 2Gig, 2 147 483 648, to be exact.
Since The Mars rovers landed, I have been storing the photographs in two directories, Spirit and Opportunity. I had more than 18 000 files in a single directory. Without being aware of it, I crossed the 2 147 483 648 border last week.
Nothing happens, if you do not attempt to read all files in the directory, or even worst, copy them to another drive.
Worried by mysterious disk errors, I tried to save my work. When making the copy however, there was an error when the copy arrived at an image and could not read it.
Foolish me, I tried to copy the file again.
That was it: the disk started to make a periodic mechanical noise, and it was GONE ALONG WITH ALL MY DATA IN THE DISK!!!!!!!!!!!!!!!!!!!!!
Why?
When a signed integer is increased beyond 2147483648, it becomes NEGATIVE. This means that the system will issue a NONSENSE movemevent order to the read heads, destroying the disk instantly.
I was lucky. I had a full backup of the mars data in my linux system. Ahh Microsoft. I fired up the linux machine running ext2 file system. I issued the order to copy the files, and started doing other things during the copy.
When the amount of data transmitted arrived at approx 2GB, I heared with horror that the disk started doing the SAME repeating mechanical noise and my linux system WAS GONE, I HAVE LOST several months of work without any means of getting my data back.
Signed integer can contain up to 2147483648 bytes. Not a single byte more.
I have developed a compile time switch to check for overflows within lcc-win32 and posted here a message, several weeks ago. Nobody cared to answer.
SHIT !!!!!!!!!!!
C is a nice language in which to write file systems. But IT WOULD BE BETTER TO BE CAREFUL WITH THOSE "int" s OK?
You do not believe me?
Try it. Make several directories with several thousand files of 100-200K each, until you get more than 2GB.
But backup your drive first...
jacob
1. This is OT
2. an "int" can be 16, 32 or 64 bits. It is the compiler / OS / CPU decision.
3. choice of signed unsigned is the programmers choice.
4. fatal overflows are the programmers fault. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: MiniDisc_2k2 |
last post by:
Okay, here's a question about the standard. What does it say about
unsigned/signed mismatches in a comparison statement:
char a = 3;
unsigned char b = 255;
if (a<b)
Now what's the real...
|
by: Siemel Naran |
last post by:
Hi. Is there a way to convert the type signed int to the type unsigned int,
char to unsigned char, signed char to unsigned char, and so on for all the
fundamental integer types? Something like
...
|
by: Fred Ma |
last post by:
Hello,
I've been trying to clear up a confusion about
integer promotions during expression evaluation.
I've checked the C FAQ and C++ FAQ (they are
different languages, but I was hoping one...
|
by: dam_fool_2003 |
last post by:
For int data type the default range starts from signed to unsigned. If
we don't want negative value we can force an unsigned value. The same
goes for long also.
But I don't understand why we have...
|
by: tinesan |
last post by:
Hello fellow C programmers,
I'm just learning to program with C, and I'm wondering what the
difference between signed and unsigned char is. To me there seems to
be no difference, and the...
|
by: Hanzac Chen |
last post by:
Hi,
I don't understand why this could happen?
The Code 1 will output `fff9'
and the Code 2 will output `1'
How could the `mod 8' not have effect?
/* Code 1 */
#include <stdio.h>
#include...
|
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= |
last post by:
Hello everybody,
this is my first post to a newsgroup at all.
I would like to get some feedback on one proposal I am thinking about:
--- begin of proposal ---
Proposal to add...
|
by: somenath |
last post by:
Hi All,
I am trying to undestand "Type Conversions" from K&R book.I am not
able to understand the
bellow mentioned text
"Conversion rules are more complicated when unsigned operands are...
|
by: Kislay |
last post by:
Consider the following code snippet
unsigned int i=10;
int j= - 2; // minus 2
if(i>j)
cout<<"i is greater";
else
cout<<"j is greater";
Since i is unsigned , j is greater . I know why , but...
|
by: Juha Nieminen |
last post by:
I was once taught that if some integral value can never have negative
values, it's a good style to use an 'unsigned' type for that: It's
informative, self-documenting, and you are not wasting half...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |