getcwd line break 80 characters

getcwd line break 80 characters

Dear All,

I'm using the getcwd function on Ubuntu Linux and the return string contains a newline statement if the current directory name is longer than 80 characters:

program myWD

 use IFPORT

 implicit none
 character(len=1024)           :: cwd
 integer                       :: error

 error = getcwd(cwd)
 print*, trim(cwd)//':'
 
end program myWD

will give

 /nethome/storage/raid4/m.diehl/DAMASK/testing/Spectral_parsingArguments/referen
 ce:
/nethome/storage/raid4/m.diehl/DAMASK/testing/Spectral_parsingArguments/refere:

if I call the program from the folder 'reference' and 'refere', respectively. Tested with ifort 13.0.1 and 12.1.2.

 

damask.mpie.de www.mpie.de
3 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

sorry, formatting didn't work:

I'm using the getcwd function on Ubuntu Linux and the return string contains a newline statement if the current directory name is longer than 80 characters:

program myWD
use IFPORT
implicit none
character(len=1024) :: cwd
integer ::error
error = getcwd(cwd)
print*, trim(cwd)//':'
end program myWD

will give

/nethome/storage/raid4/m.diehl/DAMASK/testing/Spectral_parsingArguments/referen
ce:
/nethome/storage/raid4/m.diehl/DAMASK/testing/Spectral_parsingArguments/refere:

if I call the program from the folder 'reference' and 'refere', respectively. Tested with ifort 13.0.1 and 12.1.2.

damask.mpie.de www.mpie.de

I've investigated and figured out that it's just a formatting problem and every line will break after 80 characters. The underlying reason was, that my directory detection never works but with the help of

http://software.intel.com/en-us/forums/topic/274704

it now does. For gfortran, I can simply use the directory + '/.' and check for file existance

damask.mpie.de www.mpie.de

Accedere per lasciare un commento.