LISE-B26 / pylabcontrol

pylabcontrol: Laboratory Equipment Control for Scientific Experiments.
GNU General Public License v3.0
9 stars 9 forks source link

Script loading with long filenames #128

Closed JanGieseler closed 6 years ago

JanGieseler commented 6 years ago

There seem to be still some issues with loading long filenames. Maybe that is also due to the fact that the names have dots in them

e.g. in Z:\Lab\Cantilever\Measurements\20180322_Sample_37_diamond_Y_new_pulseblaster_script\180324-18_52_04_xy8_sweep

can't load subscript with

Script.load_data(folder)

where

folder = './180324-18_52_04_xy8_sweep\\data_subscripts\\180324-18_52_14_xy8_k_double_init_1.25MHz_-13dBm_pi_pulse_blocks_k_1.000e+00'
asafira commented 6 years ago

https://stackoverflow.com/questions/18390341/unable-to-locate-files-with-long-names-on-windows-with-python

akabcenell commented 6 years ago

At some point, the following line was commented out in Script.load_data;

if len(path.split('\\?\')) == 1: path = '\\?\' + os.path.abspath(path)

This meant that the required \\?\ was not appended to long paths and therefore they were not recognized appropriately. Uncommenting the line fixed this.