Herschel observations of nearby molecular clouds suggest that interstellar filaments and prestellar cores represent two fundamental steps in the star formation process. The observations support a picture of low-mass star formation according to which filaments of ~0.1pc width form first in the cold interstellar medium, probably as a result of large-scale compression of interstellar matter by supersonic turbulent flows, and then prestellar cores arise from gravitational fragmentation of the densest filaments. Whether this scenario also applies to regions of high-mass star formation is an open question, in part because the resolution of Herschel is insufficient to resolve the inner width of filaments in the nearest regions of massive star formation. In an effort to characterize the inner width of filaments in high-mass star-forming regions, we imaged the central part of the NGC 6334 complex at a resolution higher by a factor of >3 than Herschel at 350microns. We used the large-format bolometer camera ArTeMiS on the APEX telescope and combined the high-resolution ArTeMiS data at 350microns with Herschel/HOBYS data at 70-500microns to ensure good sensitivity to a broad range of spatial scales. This allowed us to study the structure of the main narrow filament of the complex with a resolution of 8" or <0.07pc at d~1.7kpc. Our study confirms that this filament is a very dense, massive linear structure with a line mass ranging from ~500M_{sun}_/pc to ~2000M_{sun}_/pc over nearly 10pc. It also demonstrates for the first time that its inner width remains as narrow as W~0.15+/-0.05pc all along the filament length, within a factor of <2 of the characteristic 0.1pc value found with Herschel for lower-mass filaments in the Gould Belt. While it is not completely clear whether the NGC 6334 filament will form massive stars in the future, it is two to three orders of magnitude denser than the majority of filaments observed in Gould Belt clouds, and has a very similar inner width. This points to a common physical mechanism for setting the filament width and suggests that some important structural properties of nearby clouds also hold in high-mass star-forming regions.