How to create a new folder in FORTRAN 77?

This is a discussion on How to create a new folder in FORTRAN 77? within the Fortran forums in Programming Languages category; Hi, How to create a folder if it doesn't exist using FORTRAN 77 language? Regards, Praveen...

Go Back   Application Development Forum > Programming Languages > Fortran

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2008, 06:39 AM
Praveen.Kumar.Jayaram@gmail.com
Guest
 
Default How to create a new folder in FORTRAN 77?

Hi,

How to create a folder if it doesn't exist using FORTRAN 77 language?

Regards,
Praveen
Reply With Quote
  #2  
Old 08-22-2008, 07:46 AM
Dave Seaman
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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>
Reply With Quote
  #3  
Old 08-22-2008, 07:56 AM
fj
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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.
Reply With Quote
  #4  
Old 08-22-2008, 08:10 AM
Luka Djigas
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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
Reply With Quote
  #5  
Old 08-23-2008, 03:56 PM
kronecker@yahoo.co.uk
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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
Reply With Quote
  #6  
Old 08-23-2008, 05:52 PM
Terence
Guest
 
Default Re: How to create a new folder in FORTRAN 77?



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.
Reply With Quote
  #7  
Old 08-25-2008, 03:03 PM
relaxmike
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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
Reply With Quote
  #8  
Old 08-25-2008, 03:04 PM
relaxmike
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

Oups !
Flibs is only available in fortran 90, of course !
Reply With Quote
  #9  
Old 09-05-2008, 05:28 AM
Catherine Rees Lay
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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
Reply With Quote
  #10  
Old 09-05-2008, 01:16 PM
Gary Scott
Guest
 
Default Re: How to create a new folder in FORTRAN 77?

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:32 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.