| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, How to create a folder if it doesn't exist using FORTRAN 77 language? Regards, Praveen |
|
#2
| |||
| |||
| On Fri, 22 Aug 2008 03:39:23 -0700 (PDT), Praveen.Kumar.Jayaram@gmail.com wrote: > Hi, > How to create a folder if it doesn't exist using FORTRAN 77 language? Nobody had heard of "folders" on computers when the Fortran 77 standard was written. -- Dave Seaman Third Circuit ignores precedent in Mumia Abu-Jamal ruling. <http://www.indybay.org/newsitems/2008/03/29/18489281.php> |
|
#3
| |||
| |||
| On 22 août, 12:39, Praveen.Kumar.Jaya...@gmail.com wrote: > Hi, > > How to create a folder if it doesn't exist using FORTRAN 77 language? > > Regards, > Praveen There is no standard way. Nevertheless, I often use the SYSTEM routine which is usually provided with each FORTRAN compiler (with variants : sometimes a subroutine, sometimes a function, sometimes a name slightly different like FSYSTEM) : CALL system('mkdir mydirectory') If you want to create a directory with a path, then you must take care about the file delimiter. I often declare an environment variable containing the OS dependent delimiter (\ on windows and / on unix). To get this environment variable, I use the F2003 GET_ENVIRONMENT_VARIABLE routine. With older FORTRAN compilers, the corresponding non standard routine was often GETENV : CHARACTER delimiter CHARACTER*150 command CALL getenv('DELIMITER',delimiter) command='mkdir '//path//delimiter//'mydirectory' CALL system(command) Such programming is valid for Windows and Unix. |
|
#4
| |||
| |||
| On Fri, 22 Aug 2008 11:46:01 +0000 (UTC), Dave Seaman <dseaman@no.such.host> wrote: >On Fri, 22 Aug 2008 03:39:23 -0700 (PDT), Praveen.Kumar.Jayaram@gmail.com wrote: >> Hi, > >> How to create a folder if it doesn't exist using FORTRAN 77 language? > >Nobody had heard of "folders" on computers when the Fortran 77 standard was >written. Very few heard of "folders" even when the '90 standard was written ;-) Best regards digas |
|
#5
| |||
| |||
| On Aug 22, 10:39 pm, Praveen.Kumar.Jaya...@gmail.com wrote: > Hi, > > How to create a folder if it doesn't exist using FORTRAN 77 language? > > Regards, > Praveen Use a real programming language. Fortran is for number crunching only. K.D |
|
#6
| |||
| |||
| kronec...@yahoo.co.uk wrote: > Use a real programming language. Fortran is for number crunching only. > > K.D Oh! Dear me, no! I have used C, Forth, Basic, PL/1, Pascal, Algol, Cobol, Lisp, and other languages as well as Fortran in my 1960-to-date programming life. I have used Fortran F77 extensively for a variety of programming tasks: accounting, demand reporting, games, puzzle solving, sociological research, hotel management, process control, nuclear physics modelling, decompiling and program charting, and many others; actually not that much number crunching other than matrix operations and linear programming and cost optimising. I would like to say that Fortran is excellent for accounting, report writing, lanuage text parsing and file exploration and conversions. I only use Fortran 90/95 to get around Microsoft-imposed difficulties with port access and control in Windows NT and later sistems, and to imitate Windowing functions for bosses and secretaries who never heard of DOS. |
|
#7
| |||
| |||
| Hi, You may use the flibs project, especially the module m_vfile which goal is to implement a portable (that is to say, independant from the OS) way to access to files. Creating a directory with the vfile_mkdir routine : http://flibs.sourceforge.net/m_vfile.html#56 is as easy as : call vfile_mkdir("mydir") The internal method used is based on similar ideas as provided by fj. To compute a file name in a portable way, use vfile_join with the name of the directory and the name of the file : myfile = vfile_join ( dirname , filename) Here, the separator, which is platform-specific, is computed for you by the internal method in vfile_join. Notice that the full list of OS may include Mac, for which the separator is ":". Regards, Michaël |
|
#8
| |||
| |||
| Oups ! Flibs is only available in fortran 90, of course ! |
|
#9
| |||
| |||
| kronecker@yahoo.co.uk wrote: > On Aug 22, 10:39 pm, Praveen.Kumar.Jaya...@gmail.com wrote: >> Hi, >> >> How to create a folder if it doesn't exist using FORTRAN 77 language? >> >> Regards, >> Praveen > > Use a real programming language. Fortran is for number crunching only. > > K.D And real programmers writing number crunching code never need to output their data to files located in meaningful places on the disk. They just memorise it as it flashes past on the screen. (end sarcasm mode). -- Catherine Rees Lay Polyhedron Software Ltd. Registered Office: Linden House, 93 High St, Standlake, Witney, OX29 7RH, United Kingdom. Registered in England No.2541693. Vat Reg No. GB 537 3214 57 |
|
#10
| |||
| |||
| Catherine Rees Lay wrote: > kronecker@yahoo.co.uk wrote: > >> On Aug 22, 10:39 pm, Praveen.Kumar.Jaya...@gmail.com wrote: >> >>> Hi, >>> >>> How to create a folder if it doesn't exist using FORTRAN 77 language? >>> >>> Regards, >>> Praveen >> >> >> Use a real programming language. Fortran is for number crunching only. >> >> K.D > > > And real programmers writing number crunching code never need to output > their data to files located in meaningful places on the disk. They just > memorise it as it flashes past on the screen. (end sarcasm mode). > I'd also note that many of the cross-platform Fortran GUI libraries have extensive "OS" facilities for portably querying/creating/deleting/renaming/copying files, directories, etc. -- Gary Scott mailto:garylscott@sbcglobal dot net Fortran Library: http://www.fortranlib.com Support the Original G95 Project: http://www.g95.org -OR- Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html If you want to do the impossible, don't hire an expert because he knows it can't be done. -- Henry Ford |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.