creating a file

A

Anders Wegge Keller

Chris H said:
In message <[email protected]


Majority here or the majority of commercial developers? (i.e. leaving
aside home/hobby use) Then the vast majority will be developing on
Windows

One thing is what we develop *on*, another thing is what we develop
*for*. Although my editor runs on a windows machine most of the time, I
have very little practical experience with windows as a development
target.

And that aside, do you have a source for your estimate, other than
your own experience? The C developers I know, all work on embedded
systems, custom made machine controls, or various unixen. At my job,
we don't have a single line of in-house C in the Windows applications,
and looking at the offered jobs around here, almost all windows
development is Java or C#.
 
D

David Resnick

 One thing is what we develop *on*, another thing is what we develop
*for*. Although my editor runs on a windows machine most of the time, I
have very little practical experience with windows as a development
target.

 And that aside, do you have a source for your estimate, other than
your own experience? The C developers I know, all work on embedded
systems, custom made machine controls, or various unixen. At my job,
we don't have a single line of in-house C in the Windows applications,
and looking at the offered jobs around here, almost all windows
development is Java or C#.

I'm curious to see a number as well. All significant development in
our company of ~4000 people (mostly C++ or Java these days) is done on
linux. We use Windows for Office/email, but develop/deliver to
customers on linux, and have since transitioning over from Windows NT
many years back. I "develop" on windows only the extent that I'm
running an X-server on my Windows box to open terminals on my linux
one. "vast majority will be developing on Windows" sounds quite
unlikely to me, but I could be convinced if there were a real source
rather than someones perhaps parochial opinion ("nobody I know voted
for Nixon, how did he win?"). While the overwhelming majority of
desktop PCs are still Windows (see http://en.wikipedia.org/wiki/Usage_share_of_operating_systems,
e.g.), I personally very much doubt that the "vast majority" of
commercial development targets PCs, as opposed to say non-Windows
based servers, embedded work, mobile devices, etc. But that could
just be my parochial opinion too...

-David
 
J

jacob navia

Le 25/02/11 15:10, Rui Maciel a écrit :
When was the last time you gave any linux distro a try?


Rui Maciel

I am using Ubuntu, last time I used it was around 5 minutes ago.
And when was the last time you used Mac OSX?

:)

What is missing in linux and what makes the strength of Mac OSX
can be described in one word:

INTEGRATION

Cut and paste works very well, the applications have a similar look and
feel, the GUI is nicely done, and the intuitive programs are easy on
new people. My wife is using immediately her MacBook, without any
training.

Network configuration is done automatically, and it works. Integrated
TV, music, DVD, camera, microphone, everything works.

As in Linux. Everything works under linux too because if it doesn't
(what is most often the case) *I* can make it work. I have never
found any problem under Linux that I could not fix. It just costed
me HOURS of googling, etc. And I know for sure that only a professional
would have been able to do that.

Sometimes it just wasn't worth the effort.

Linux is nice, I have several virtual machines with it running in my
Mac. I test my code under linux gcc (that is different from Apple's
gcc).

It is a useful system for system administrators and big companies
that need a cheap server system.

Nothing else.

jacob
 
C

Chris H

Anders Wegge Keller said:
One thing is what we develop *on*, another thing is what we develop
*for*. Although my editor runs on a windows machine most of the time, I
have very little practical experience with windows as a development
target.

And that aside, do you have a source for your estimate, other than
your own experience?

My estimate is working for some leasing distributors of embedded tools
for the last decade. I speak to many different companies daily. The
number who are using Windows as a platform to develop on far outweighs
those using any other platform

Depending on the industry the next level is MAC, Unix or Linux.
The C developers I know, all work on embedded
systems, custom made machine controls, or various unixen.

Yes.. But in my experience the vast majority do that development on a
windows platform.
At my job,
we don't have a single line of in-house C in the Windows applications,
and looking at the offered jobs around here, almost all windows
development is Java or C#.

I would agree with that.
 
C

Chris H

Rui Maciel said:
When was the last time you gave any linux distro a try?

Last time I looked on the sight that tracks Linux distros about 50% were
"obsolete / unsupported"

This is the problem with Linux.... very many variations and half of them
disappear after a year or so. Philipe Khan (Borland) said that UNIX
would never become dominant because of the multiple versions (three or
four I think at the time ) and he was a UNIX fan.
 
C

Chris H

jacob navia said:
Le 25/02/11 15:10, Rui Maciel a écrit :

I am using Ubuntu, last time I used it was around 5 minutes ago.
And when was the last time you used Mac OSX?

NOW! I am running three windows Manchines, One MAC and one box running
Linux.
What is missing in linux and what makes the strength of Mac OSX
can be described in one word:

INTEGRATION

No... Stability. Linux Distributions come and go, they have irregular
patches and keep changing.
As in Linux. Everything works under linux too because if it doesn't
(what is most often the case) *I* can make it work. I have never
found any problem under Linux that I could not fix. It just costed
me HOURS of googling, etc. And I know for sure that only a professional
would have been able to do that.

Hours cost MONEY Ask any professional
 
A

Anders Wegge Keller

Chris H said:
In message <[email protected]>, Anders Wegge Keller
My estimate is working for some leasing distributors of embedded
tools for the last decade. I speak to many different companies
daily. The number who are using Windows as a platform to develop on
far outweighs those using any other platform

I'll agree on the development platform. But I originally misread it
as target platform, since you commented in a thread where Windows as a
target was discussed.
 
C

Chris H

Anders Wegge Keller said:
I'll agree on the development platform. But I originally misread it
as target platform, since you commented in a thread where Windows as a
target was discussed.

No idea.. In 30 years of Sw development I have only ever written one
program for a MS platform and that was a terminal emulator in C and
assembler just for fun.
 
D

Default User

Chris H said:
No idea.. In 30 years of Sw development I have only ever written one
program for a MS platform and that was a terminal emulator in C and
assembler just for fun.

Having worked largely on developmental tasks, I've used a wide variety of
platforms. These include MSDOS, HPUX, Windows (various versions), and Linux.
There were also projects that had both Windows desktop versions and
cross-compiled target versions for VxWorks (RTOS), and AE653 (partitioned
RTOS). Some were multi-platform, Windows and Linux. Sometimes C, sometimes
C++.

Somewhat sadly, I've had to leave the R&D world and move to a new position
at the cumpnee. This will involve programming for an embedded Windows XP
board.



Brian
 
B

BartC

Mark Bluemel said:
Cue for a debate (or even a flame war). I haven't taken a census, but
I'm far from convinced that the majority here have experience of
developing on Windows.

Anyone developing applications for ordinary consumers, until recently would
probably have meant developing for PCs running Windows (since that hardware
is ubiquitous, cheap, and can be purchased anywhere).

But you're probably right in that probably a minority of the experts here
(and a bigger proportion of the people asking questions) develop for
Windows.
 
R

Rui Maciel

jacob said:
Le 25/02/11 15:10, Rui Maciel a écrit :

I am using Ubuntu, last time I used it was around 5 minutes ago.
And when was the last time you used Mac OSX?

:)

I posted that question because you made the following claim:

<quote>
after more than a decade their system is as "usable" as SCO + Xwindows
was.
</quote>

There are a hand full of desktop environments for linux which evolved
considerably and brought linux into the forefront of usability. Some DEs
managed to do so well that their efforts have been the source of
inspiration for others (i.e., ripped off). A notorious example can be
found in how Microsoft found inspiration in KDE for it's windows 7 DE.
So, knowing this, it becomes clear that linux managed to considerably
improve it's usability, a long way since the days of SCO + Xwindows.

What is missing in linux and what makes the strength of Mac OSX
can be described in one word:

INTEGRATION

Cut and paste works very well, the applications have a similar look and
feel, the GUI is nicely done, and the intuitive programs are easy on
new people. My wife is using immediately her MacBook, without any
training.

Was that the first time ever that your wife used a computer?

Network configuration is done automatically, and it works. Integrated
TV, music, DVD, camera, microphone, everything works.

The last time I've installed a linux distribution from scratch (Kubuntu
10.10) the only tweaking it needed was installing proprietary drivers for
my graphics card. In spite of that, the default driver worked flawlessly,
although the was no hardware acceleration. USB cameras work out of the
box too, provided they are UVC or, if it's not the case, there are drivers
for it. Therefore, I don't see a difference.

Besides that, playing music and DVDs leads the user to install extra
packages which aren't installed by default due to legal restrictions.
Even then, I would hardly call that unfriendly.

As in Linux. Everything works under linux too because if it doesn't
(what is most often the case) *I* can make it work. I have never
found any problem under Linux that I could not fix. It just costed
me HOURS of googling, etc. And I know for sure that only a professional
would have been able to do that.

Sometimes it just wasn't worth the effort.

I've been using linux almost exclusively for a considerable number of
years and, considering the state where linux in the desktop has been in
the last 3 years or so, I don't see that many problems.

Granted, I've managed to put together systems which were assembled from
components that are supported under linux and I tend to use polished
distributions from established projects. As a consequence, they work
flawlessly even after reinstalling the OS, without needing any tweaking
whatsoever, let alone costing any googling.

So, as it's possible to have a flawless linux system up and running right
from the moment the install process finishes (which takes about 8 minutes
or so) I don't see how linux isn't worth the effort, mainly because no
effort is actually needed.

Linux is nice, I have several virtual machines with it running in my
Mac. I test my code under linux gcc (that is different from Apple's
gcc).

It is a useful system for system administrators and big companies
that need a cheap server system.

Nothing else.

There is no problem if you believe that linux in the desktop is useless.
Those who actually use it may not agree with you but you are still
entitled to your opinion.


Rui Maciel
 
B

BartC

Hans Vlems said:
I was asked for a program that creates a file with a predermined
filesize.
Filesize is specifcied in bytes, but it is acceptable if the filesize
ought to be a multiple of, say, the blocksize of the disk.
On a VMS system creat has a few platform specific enhancements. But
this needs to run on a WIndows XP system. Is there a function to do
that, for either Visual C or the djgpp environment?

This seems to work under Windows, and uses only standard C functions. Some
error checking might be needed.

It skips N-1 bytes, then writes a single byte for a total of N bytes. N
should be 1 or more.

#include <stdio.h>
#include <stdlib.h>

#define FILESIZE 1000000

int main(void){
FILE *f;
char c=0;

f=fopen("testfile","wb");
fseek(f,FILESIZE-1,SEEK_SET);
fwrite(&c,1,1,f);
fclose(f);
}
 
R

Rui Maciel

Chris said:
Last time I looked on the sight that tracks Linux distros about 50% were
"obsolete / unsupported"

No one is forced to use a distribution which is either obsolete or
unsupported. Just pick a distro which actually works, and stuff tends to
actually work.

This is the problem with Linux.... very many variations and half of them
disappear after a year or so.

This point is mentioned frequently and no matter how many times it is
pointed out it always fails to become relevant. No one forces you to run
obscure and dead distros, as no one forces you to run each and every half-
baked distro that manages to pop out. Therefore, it's irrelevant if there
are "very many variations" or that if 90% of those may disapear after a
year. You only need to get your hands on a single distribution that
actually works, from a project that will not disapear in the near future.
Nowadays you have half a dozen distros that fit that description, and
pretty much you can use any of those without having to worry about
anything.

Philipe Khan (Borland) said that UNIX
would never become dominant because of the multiple versions (three or
four I think at the time ) and he was a UNIX fan

It really depends on what you mean by "dominant". Over 90% of Top500's
entries are linux systems, and around 2/3 of the smartphone market is
attributed to linux. According to some yardsticks, these values may be
considered "dominant".


Rui Maciel
 
D

Dr Nick

Mark Bluemel said:
Cue for a debate (or even a flame war). I haven't taken a census, but
I'm far from convinced that the majority here have experience of
developing on Windows.

I've not got a Windows machine in the house, and haven't used it for
anything other than office work at work for over a decade now.
 
D

Dr Nick

Chris H said:
Last time I looked on the sight that tracks Linux distros about 50% were
"obsolete / unsupported"

This is the problem with Linux.... very many variations and half of them
disappear after a year or so.

Whereas Windows hasn't changed at all in the last few years of course!
How long did Vista last for?
 
M

Michael Press

Hans Vlems said:
That was my first idea too, before the platform was revealed, Windows
and NTFS.
Windows routinely uses disks of 500 GB and more, so writing records is
probably slow.


So the idea of just writing enough (large) records to a file to match
a prerequisite size might turn out as
a very slow process. I don't know yet what filesizes will be desired.
Anything < 1 GB and it wouldn't matter

fopen(3), fseek(3), fwrite(3), fclose(3). If the file is very, very large
use fsetpos(3) instead of fseek. The fwrite can be one byte.

$cat try.c
#include <stdio.h>

int main(void)
{
char a[1] = {0};
FILE *fp;

fp = fopen("eraseme", "w");
fseek(fp, 0x2000, SEEK_SET);
fwrite(a, sizeof(a[0]), 1, fp);
fclose(fp);
return 0;
}
$cc try.c
$ls -lo eraseme
ls: eraseme: No such file or directory
$./a.out
$ ls -lo eraseme
-rw-r--r-- 1 mdp 8193 Feb 25 22:02 eraseme
 
B

Ben Bacarisse

Michael Press said:
fopen(3), fseek(3), fwrite(3), fclose(3). If the file is very, very large
use fsetpos(3) instead of fseek. The fwrite can be one byte.

There is a problem with using fsetpos to set an specific byte offset: we
are told nothing about the fpos_t type other than that it is an object
type and that it can represent file positions. The fact that is it not
guaranteed to be either an integer type or even an arithmetic type is
presumably deliberate, so it can't be used in portable C to do anything
but return to previously determined positions.

<snip>
 
C

Chris H

Rui Maciel said:
No one is forced to use a distribution which is either obsolete or
unsupported. Just pick a distro which actually works, and stuff tends to
actually work.

You completely missed the point. Some of the current list of obsolete
and unsupported distributions were the Ubuntu's of their day. My
point is almost ANY Linux distribution you pick stands at least a 50%
chance of becoming obsolete and unsupported within 5 years.
This point is mentioned frequently and no matter how many times it is
pointed out it always fails to become relevant.

Not true. It has become relevant for quite a few people but they tend
to not want speak about it publicly.
No one forces you to run
obscure and dead distros, as no one forces you to run each and every half-
baked distro that manages to pop out.

Perhaps you can tell me EXACTLY which distributions will absolutely
certainly be here in 10 years time and which will not. Your house or
business will do as collateral for the bet.
 
C

Chris H

Dr Nick said:
Whereas Windows hasn't changed at all in the last few years of course!
How long did Vista last for?

Apples and oranges. How many versions of Linux are there? Never mid
different distributions. Windows, link Linux evolves.
 
A

Anders Wegge Keller

Chris H said:
You completely missed the point. Some of the current list of
obsolete and unsupported distributions were the Ubuntu's of their
day. My point is almost ANY Linux distribution you pick stands at
least a 50% chance of becoming obsolete and unsupported within 5
years.

Microsoft have long ceased support for Windows 95, 98, NT 3.51,
4.0. It should not come as a big suprise that linux distros also will
be EOL at some point.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top