143 stories

The early history of Windows file attributes, and why there is a gap between System and Directory

1 Comment

Let's look at the values for the basic Windows file attributes. There's a gap where 8 should be.

READONLY 0x00000001
HIDDEN 0x00000002
SYSTEM 0x00000004
DIRECTORY 0x00000010
ARCHIVE 0x00000020

Rewind to CP/M.

CP/M supported eleven attributes:

Name Meaning
F1, F2, F3, F4 User-defined
F5, F6, F7, F8 Interface-defined
T1 Read-only
T2 System
T3 Archive

The operating system imposed no semantics for user-defined attributes. You can use them for whatever you want.

The meanings of the interface-defined attributes were defined by each operating system interface. Think of them as four bonus flag parameters for each syscall that takes a file control block. You could set interface-defined attributes before calling a function, and that passed four additional flags in. Or the function could manipulate those attributes before returning, allowing it to return four flags out. Interface-defined attributes are always clear on disk.

The read-only bit marked a file as read-only.

The system bit had two effects: First, it hid the file from directory listings. Second, if the file belonged to user 0,¹ then the file was available to all users. (This was handy for program files.)

The archive bit reported whether the file has been backed up.

These attributes were retrofitted onto the existing directory structure by taking over the high bits of the eleven filename characters! That's why they are named F1 through F8 (high bits of the eight-character file base name) and T1 through T3 (high bits of the three-character extension, also known as the file type).

You can infer from this that CP/M file names were limited to 7-bit ASCII.

Anyway, MS-DOS 1.0 split the dual meaning of the system attribute into two attribute (hidden and system), and even though it didn't implement the read-only attribute, it reserved space for it.

That explains why the first three attributes are read-only (1), hidden (2), and system (4).

MS-DOS 2.0 most notably added support for subdirectories, but another feature that came along was volume labels. Since there was no space for the volume label in the disk header, the volume label was added as a directory entry in the root directory, with a special attribute that says "This is a volume label, not a file."²

The next attributes became volume label (8), directory (16), and archive (32).

Win32 adopted the same file attribute values as MS-DOS and 16-bit Windows, presumably in an effort to minimize surprises when porting code from 16-bit to 32-bit. The volume label attribute disappeared from Win32, but the bits for directory and archive were left at their original values to avoid problems with programs that operated with file attributes. Those programs contained their own definitions for the file attributes because 16-bit Windows didn't provide any.

¹ CP/M supported up to 16 users, numbered 0 through 15. When you started the computer, you were user 0, but you could change users by saying USER n. Files belonging to other users were inaccessible, except that system files belong to user 0 were available to everyone. Anybody could change to any user at any time, so this was a file organization feature, not a security feature. In practice, nobody really used it because floppy discs were so small that it was easier to organize your files by putting them on different floppies than by trying to remember which user you used for each file.

² Windows 95 later repurposed the volume label attribute to mark directory entries as being used for long file names. Disk utilities often parsed directory entries directly, so any change in the disk format was a compatibility risk. The choice to use the volume label attribute for this purpose came after a lot of experimentation to find the least disruptive file format for long file names. It turns out that most low-level disk utility programs ignored anything marked with the volume label attribute.

Read the whole story
139 days ago
I knew that it was the Volume Label flag, and that it was used for LFNs.
I had no idea it was deprecated and no longer in the documentation though!
The CP/M stuff is fascinating. I never really used CP/M enough for that to be something I'd have noticed, kinda want to have a tinker now...
London, United Kingdom
Share this story

New US Tariffs are Anti-Maker and Will Encourage Offshoring

3 Comments and 5 Shares

The new 25% tariffs announced by the USTR, set to go into effect on July 6th, are decidedly anti-Maker and ironically pro-offshoring. I’ve examined the tariff lists (List 1 and List 2), and it taxes the import of basic components, tools and sub-assemblies, while giving fully assembled goods a free pass. The USTR’s press release is careful to mention that the tariffs “do not include goods commonly purchased by American consumers such as cellular telephones or televisions.”

Think about it – big companies with the resources to organize thousands of overseas workers making TVs and cell phones will have their outsourced supply chains protected, but small companies that still assemble valuable goods from basic parts inside the US are about to see significant cost increases. Worse yet educators, already forced to work with a shoe-string budget, are going to return from their summer recess to find that basic parts, tools and components for use in the classroom are now significantly more expensive.

Above: The Adafruit MetroX Classic Kit is representative of a typical electronics education kit. Items marked with an “X” in the above image are potentially impacted by the new USTR tariffs.

New Tariffs Reward Offshoring, Encourage IP Flight

Some of the most compelling jobs to bring back to the US are the so-called “last screw” system integration operations. These often involve the complex and precise process of integrating simple sub-assemblies into high-value goods such as 3D printers or cell phones. Quality control and IP protection are paramount. I often advise startups to consider putting their system integration operations in the US because difficult-to-protect intellectual property, such as firmware, never has to be exported if the firmware upload operation happens in the US. The ability to leverage China for low-value subassemblies opens more headroom to create high-value jobs in the US, improving the overall competitiveness of American companies.

Unfortunately, the structure of the new tariffs are exactly the opposite of what you would expect to bring those jobs back to the US. Stiff new taxes on simple components, sub-assemblies, and tools like soldering irons contrasted against a lack of taxation on finished goods pushes business owners to send these “last screw” operation overseas. Basically, with these new tariffs the more value-add sent outside the borders of the US, the more profitable a business will be. Not even concerns over IP security could overcome a 25% increase in base costs and keep operations in the US.

It seems the intention of the new tariff structure was to minimize the immediate pain that voters would feel in the upcoming mid-terms by waiving taxes on finished goods. Unfortunately, the reality is it gives small businesses that were once considering setting up shop in the US a solid reason to look off-shore, while rewarding large corporations for heavy investments in overseas operations.

New Tariffs Hurt Educators and Makers

Learning how to blink a light is the de-facto introduction to electronics. This project is often done with the help of a circuit board, such as a Microbit or Chibi Chip, and a type of light known as an LED. Unfortunately, both of those items – simple circuit boards and LEDs – are about to get 25% more expensive with the new tariffs, along with other Maker and educator staples such as capacitors, resistors, soldering irons, and oscilloscopes. The impact of this cost hike will be felt throughout the industry, but most sharply by educators, especially those serving under-funded school districts.

Above: Learning to blink a light is the de-facto introduction to electronics, and it typically involves a circuit board and an LED, like those pictured above.

Somewhere on the Pacific Ocean right now floats a container of goods for ed-tech startup Chibitronics. The goods are slated primarily for educators and Makers that are stocking up for the fall semester. It will arrive in the US the second week of July, and will likely be greeted by a heavy import tax. I know this because I’m directly involved in the startup’s operations. Chibitronics’ core mission is to serve the educator market, and as part of that we routinely offered deep discounts on bulk products for educators and school systems. Now, thanks to the new tariffs on the basic components that educators rely upon to teach electronics, we are less able to fulfill our mission.

A 25% jump in base costs forces us to choose between immediate price increases or cutting the salaries of our American employees who support the educators. These new tariffs are a tax on America’s future – it deprives some of the most vulnerable groups of access to technology education, making future American workers less competitive on the global stage.

Above: Educator-oriented learning kits like the Chibitronics “Love to Code” are slated for price increases this fall due to the new tariffs.

Protectionism is Bad for Technological Leadership

Recently, I was sent photos by Hernandi Krammes of a network card that was manufactured in Brazil around 1992. One of the most striking features of the card was how retro it looked – straight out of the 80’s, a full decade behind its time. This is a result of Brazil’s policy of protectionist tariffs on the import of high-tech components. While stiff tariffs on the import of microchips drove investment in local chip companies, trade barriers meant the local companies didn’t have to be as competitive. With less incentive to re-invest or upgrade, local technology fell behind the curve, leading ultimately to anachronisms like the Brazilian Ethernet card pictured below.

Above: this Brazilian network card from 1992 features design techniques from the early 80’s. It is large and clunky compared to contemporaneous cards.

Significantly, it’s not that the Brazilian engineers were any less clever than their Western counterparts: they displayed considerable ingenuity getting a network card to work at all using primarily domestically-produced components. The tragedy is instead of using their brainpower to create industry-leading technology, most of their effort went into playing catch-up with the rest of the world. By the time protectionist policies were repealed in Brazil, the local industry was too far behind to effectively compete on a global scale.

Should the US follow Brazil’s protectionist stance on trade, it’s conceivable that some day I might be remarking on the quaintness of American network cards compared to their more advanced Chinese or European counterparts. Trade barriers don’t make a country more competitive – in fact, quite the opposite. In a competition of ideas, you want to start with the best tech available anywhere; otherwise, you’re still jogging to the starting line while the competition has already finished their first lap.

Stand Up and Be Heard

There is a sliver of good news in all of this for American Makers. The list of commodities targeted in the trade war is not yet complete. The “List 2” items – which include all manner of microchips, motors, and plastics (such as 3D printer PLA filament and acrylic sheets for laser cutting) that are building blocks for small businesses and Makers – have yet to be ratified. The USTR website has indicated in the coming weeks they will disclose a process for public review and comment. Once this process is made transparent – whether you are a small business owner or the parent of a child with technical aspirations – I encourage you to please share your stories and concerns on how you will be negatively impacted by these additional tariffs.

Some of the List 2 items still under review include:

9030.31.00 Multimeters for measuring or checking electrical voltage, current, resistance or power, without a recording device
8541.10.00 Diodes, other than photosensitive or light-emitting diodes
8541.40.60 Diodes for semiconductor devices, other than light-emitting diodes, nesoi
8542.31.00 Electronic integrated circuits: processors and controllers
8542.32.00 Electronic integrated circuits: memories
8542.33.00 Electronic integrated circuits: amplifiers
8542.39.00 Electronic integrated circuits: other
8542.90.00 Parts of electronic integrated circuits and microassemblies
8501.10.20 Electric motors of an output of under 18.65 W, synchronous, valued not over $4 each
8501.10.60 Electric motors of an output of 18.65 W or more but not exceeding 37.5 W
8501.31.40 DC motors, nesoi, of an output exceeding 74.6 W but not exceeding 735 W
8544.49.10 Insulated electric conductors of a kind used for telecommunications, for a voltage not exceeding 80 V, not fitted with connectors
8544.49.20 Insulated electric conductors nesoi, for a voltage not exceeding 80 V, not fitted with connectors
3920.59.80 Plates, sheets, film, etc, noncellular, not reinforced, laminated, combined, of other acrylic polymers, nesoi
3916.90.30 Monafilament nesoi, of plastics, excluding ethylene, vinyl chloride and acrylic polymers

Here’s some of the “List 1” items that are set to become 25% more expensive to import from China, come July 6th:

Staples used by every Maker or electronics educator:

8515.11.00 Electric soldering irons and guns
8506.50.00 Lithium primary cells and primary batteries
8506.60.00 Air-zinc primary cells and primary batteries
9030.20.05 Oscilloscopes and oscillographs, specially designed for telecommunications
9030.33.34 Resistance measuring instruments
9030.33.38 Other instruments and apparatus, nesoi, for measuring or checking electrical voltage, current, resistance or power, without a recording device
9030.39.01 Instruments and apparatus, nesoi, for measuring or checking

Circuit assemblies (like Microbit, Chibi Chip, Arduino):

8543.90.68 Printed circuit assemblies of electrical machines and apparatus, having individual functions, nesoi
9030.90.68 Printed circuit assemblies, NESOI

Basic electronic components:

8532.21.00 Tantalum fixed capacitors
8532.22.00 Aluminum electrolytic fixed capacitors
8532.23.00 Ceramic dielectric fixed capacitors, single layer
8532.24.00 Ceramic dielectric fixed capacitors, multilayer
8532.25.00 Dielectric fixed capacitors of paper or plastics
8532.29.00 Fixed electrical capacitors, nesoi
8532.30.00 Variable or adjustable (pre-set) electrical capacitors
8532.90.00 Parts of electrical capacitors, fixed, variable or adjustable (pre-set)
8533.10.00 Electrical fixed carbon resistors, composition or film types
8533.21.00 Electrical fixed resistors, other than composition or film type carbon resistors, for a power handling capacity not exceeding 20 W
8533.29.00 Electrical fixed resistors, other than composition or film type carbon resistors, for a power handling capacity exceeding 20 W
8533.31.00 Electrical wirewound variable resistors, including rheostats and potentiometers, for a power handling capacity not exceeding 20 W
8533.40.40 Metal oxide resistors
8533.40.80 Electrical variable resistors, other than wirewound, including rheostats and potentiometers
8533.90.80 Other parts of electrical resistors, including rheostats and potentiometers, nesoi
8541.21.00 Transistors, other than photosensitive transistors, with a dissipation rating of less than 1 W
8541.29.00 Transistors, other than photosensitive transistors, with a dissipation rating of 1 W or more
8541.30.00 Thyristors, diacs and triacs, other than photosensitive devices
8541.40.20 Light-emitting diodes (LED’s)
8541.40.70 Photosensitive transistors
8541.40.80 Photosensitive semiconductor devices nesoi, optical coupled isolators
8541.40.95 Photosensitive semiconductor devices nesoi, other
8541.50.00 Semiconductor devices other than photosensitive semiconductor devices, nesoi
8541.60.00 Mounted piezoelectric crystals
8541.90.00 Parts of diodes, transistors, similar semiconductor devices, photosensitive semiconductor devices, LED’s and mounted piezoelectric crystals
8504.90.75 Printed circuit assemblies of electrical transformers, static converters and inductors, nesoi
8504.90.96 Parts (other than printed circuit assemblies) of electrical transformers, static converters and inductors
8536.50.90 Switches nesoi, for switching or making connections to or in electrical circuits, for a voltage not exceeding 1,000 V
8536.69.40 Connectors: coaxial, cylindrical multicontact, rack and panel, printed circuit, ribbon or flat cable, for a voltage not exceeding 1,000 V
8544.49.30 Insulated electric conductors nesoi, of copper, for a voltage not exceeding 1,000 V, not fitted with connectors
8544.49.90 Insulated electric conductors nesoi, not of copper, for a voltage not exceeding 1,000 V, not fitted with connectors
8544.60.20 Insulated electric conductors nesoi, for a voltage exceeding 1,000 V, fitted with connectors
8544.60.40 Insulated electric conductors nesoi, of copper, for a voltage exceeding 1,000 V, not fitted with connectors

Parts to fix your phone if it breaks:

8537.10.80 Touch screens without display capabilities for incorporation in apparatus having a display
9033.00.30 Touch screens without display capabilities for incorporation in apparatus having a display
9013.80.70 Liquid crystal and other optical flat panel displays other than for articles of heading 8528, nesoi
9033.00.20 LEDs for backlighting of LCDs
8504.90.65 Printed circuit assemblies of the goods of subheading 8504.40 or 8504.50 for telecommunication apparatus

Power supplies:

9032.89.60 Automatic regulating or controlling instruments and apparatus, nesoi
9032.90.21 Parts and accessories of automatic voltage and voltage-current regulators designed for use in a 6, 12, or 24 V system, nesoi
9032.90.41 Parts and accessories of automatic voltage and voltage-current regulators, not designed for use in a 6, 12, or 24 V system, nesoi
9032.90.61 Parts and accessories for automatic regulating or controlling instruments and apparatus, nesoi
8504.90.41 Parts of power supplies (other than printed circuit assemblies) for automatic data processing machines or units thereof of heading 8471
Read the whole story
212 days ago
Trade wars are never a good idea unless you have a monopoly.
Bunnie lays out the long-term implications for America's economy very effectively here.
It can't be the intended result that the big multinationals will potentially benefit by removing small competition. It can't be the intended result that this restricts access to educational opportunities.
Sadly, I doubt that those behind the trade war care about anything other than how tough they think they look...
London, United Kingdom
Share this story
2 public comments
211 days ago
bunnie lays it out for you
Earth, Sol system, Western spiral arm
212 days ago
This is pretty fucking relevant both to my interests and to my continued gainful employment.
Boulder, CO

Trapped by history


A little bit of me feels sorry for Toby Young. I say so because of something Dan Davies tweeted:

Find a brand and stick to it. Don't try to be jack the lad when poundshop Clarksons are in fashion, then pull on the leather elbow patches as soon as you think there's more of a market for Serious.

The point here is that we can be trapped by our brands: Young’s reputation as cheap controversialist disqualifies him from a serious job even if he might be otherwise equipped to do it.

His is not an isolated case. Sam Allardyce has earned a reputation for playing effective but ugly route one football. He objects that he’s had to do this because of the limited ability of the players he’s managed and that he could get a team to play attractive football if he had the chance. But except for a brief period at Bolton, he’s never had that chance.

Similarly, my reputation means I’m unemployable elsewhere: who wants to hire someone who seems to mix dull technocracy with class hatred?

Much more seriously, ex-prisoners and the long-term unemployed find it hard to get work because employers don’t believe they can change.

Our histories, then, limit our options.

This isn’t wholly unreasonable. What we have done in the past is at least some guide to our abilities and character. Mr Young has forgotten that if a man acts like a cunt, a good Bayesian will increase the probability he attaches to the prior belief that he really is a cunt. Many of us are one-trick ponies: for example, I really am unemployable elsewhere. Just as societies are created by their past, and companies cannot easily change their core competences, so too do individuals struggle to change. This is why the decline of old industries is so traumatic: unemployed steel-workers or miners don’t become coders.

But, but but. It’s also possible that employers overstate the extent to which abilities and aptitudes are fixed, and exaggerate the correlation between what somebody has done and what they can do. People are often terrible at judging correlations: why shouldn’t they be so in this case?

I can’t prove this, simply because we don’t see what doesn’t happen: if you don’t hire a guy, you never find out how good he is. One factoid, however, lends it credence – that Timpsons, which does try to employ ex-cons, does OK by doing so.

What seems clearer, though, is the obverse of this. As Marko Tervio has shown, hirers place a premium upon revealed talent – those with the right CV. This is one reason why I advise youngsters to work in finance: an investment bank looks good on your CV.

Revealed talent, however, is scarcer than actual talent. It’s for this reason that Premier League teams tend to hire the same old faces as bosses; why some folk hoover up lots of non-executive directorships; why talking heads current affairs shows have a limited roster of guests; and why there’s a management merry-go-round with a few people jumping from job to job.

And because revealed talent is so scarce, those who have it earn fortunes even if they are only just above a threshold of basic competence.

Which raises a nice paradox. Those people who think that Young’s past disqualifies him from a serious job are doing the same thing that companies do when they refuse to hire the ex-con or when they pay gazillions to mediocre bosses. They are using the same mindset that gives us gross inequalities.

Read the whole story
372 days ago
An interesting point of view. I don't think that Toby Young's previous behaviour should have allowed him to be considered, but that doesn't mean he can't change. He should, however, demonstrate that change before he's considered for such roles.
London, United Kingdom
370 days ago
I think recent revelations since this article came out have rendered that a moot point.
369 days ago
Yeah, as ever Future Politics mocks what Present Me writes...
368 days ago
That's always the way, unfortunately. But I do agree with you that people can change, and that if they demonstrate that change they should be given a second chance.
Share this story
1 public comment
372 days ago
Interesting point regarding revealed talent versus actual talent.

Why we don't commute with helicopters

1 Comment

Choppers are now associated mostly with militaries, hospitals, news reporting and other institutional uses. But they were once seriously touted as mass transit vehicles, the original flying car. It all came to an end in 1977, when four passengers were killed in the spectacularly nasty Panam rooftop disaster. Efforts to revive scheduled passenger helicopter service is periodically revived, but everyone's failed at it -- including future president Donald Trump.

Read the whole story
521 days ago
Well, yes, accidents.
Oh, and the fact that it's really inefficient and expensive.
Even most of the people who read Bloomberg can't really justify the expensive of a daily commute by helicopter...
London, United Kingdom
Share this story

MAC randomization: A massive failure that leaves iPhone, Android mobes open to tracking

1 Comment

Security flaws smash worthless privacy protection

Analysis To protect mobile devices from being tracked as they move through Wi-Fi-rich environments, there's a technique known as MAC address randomization. This replaces the number that uniquely identifies a device's wireless hardware with randomly generated values.…

Read the whole story
677 days ago
This is interesting, because nobody gets it right. Samsung just forgets to turn the feature on. Apple did it correctly, then broke it, and are trampling on other's property when they do it anyway.
And it's all moot, because a chipset issue (which isn't specified) means that MAC address randomisation doesn't work.
Basically, evading tracking is hard. And this is just at one level of the stack...
London, United Kingdom
Share this story

This photo of some strawberries with no red pixels is the new 'the dress'

1 Comment

UCLA neuroscientist Matt Lieberman posted the 'no red pixels' image on the left. It's developed from an original by Experimental Psychologist Akiyoshi Kitaoka (right) that, despite appearances, does have some very slightly red-tinged pixels in it.

Remember internet kerfuffle that was 'the dress' ? Well, there's another optical illusion that's puzzling the internet right now. Behold: the red strawberries that aren't really red. Or more specifically, the image of the strawberries contains no 'red pixels.'

The important distinction to make here is that there is red information in the image but, despite what your eyes might be telling you, red is not the highest value for any individual pixel in the image. Hence, no 'red pixel' in the image.

As was the case with 'the dress,' it all relates to a concept called color constancy, which relates to the human brain's ability to perceive objects as the same color under different lighting. Which should immediately bring to mind a familiar photographic concept: white balance. Although there's a significant cyan cast to the whole image, your brain is able to correct for it without you having to consciously identify a neutral part of the image (as you'd need to in processing software).

As a photographer, this should make it clear just how clever auto white balance algorithms have become and also why, when color accuracy is critical, you're still better off telling the camera or leaving yourself a target to confirm what grey looks like in the available lighting.

We have Experimental Psychologist Akiyoshi Kitaoka to thank for turning this puzzle loose on the world, and neuroscientist Matt Lieberman for turning it viral. Curiously, the first image contains a few red-dominated pixels (which Lieberman's edited version doesn't), yet appears more grey than Lieberman's version.

Read the whole story
686 days ago
I remember early digital cameras and their white balance. Got snow? The world turns cyan.
My smartphone does better white balance than a 2002 digital camera. Which is amazing. Especially when these images show how fickle human vision is...
London, United Kingdom
Share this story
Next Page of Stories