Fedora Linux Support Community & Resources Center
  #1  
Old 30th April 2010, 02:51 PM
oclinux Offline
Registered User
 
Join Date: Apr 2010
Posts: 2
linuxsafari
Fortran Programs and long path names input's

Hello Community,

I have a fortran program example call like this:

/home/oclinux/foo/foo2/foo3/fprogram /home/oclinux/foo9/foo8/foo7/foo6/foo5/fortinput.in


This call cant run my fortran program because they output to the screen that the file ' ' (empty) cant be loaded!

So the problem is that my program cant see the file in the long path name above ( the real name is a bit more longer). I try with shorts path names , and the program can run, reading the input file.

I googleit for this type of error and only found that bash have limits on the filenames and inputs, so i change them (/usr/local/linux/limits.h or some like) to a very high value (999) ,but no success.


I appreciate if some one have a elegant and simple way to solve this problem, focus on a user change rather than admin (some call or set in bash!?), but if the problem needs admin changes i dont worry.

Thanks

---------- Post added at 10:51 AM CDT ---------- Previous post was at 10:36 AM CDT ----------

Just to remember:

I try some others things:

fprogram < file
export x=longpathtofile
fprgrogram $x
fprgrogram < $x



Nothing....


PS: the " cd to folder" and "fprogram file" is not a option , because this call is inside others routines, so this solution will require a lot of work , because all my scripts are set to the full path name, and not implicit paths ( like ".." ).

Thankz
Reply With Quote
  #2  
Old 30th April 2010, 03:22 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: Fortran Programs and long path names input's

This isn't anywhere near the bash limits (thats somewhere around 10K for parameters)

And pathnames are allowed to be 512 bytes (513 with null terminator).

It looks more like the fortran program isn't handling parameters properly, and what
should be a file name isn't (it may be null).

For debugging this, you can try to print the file name before you open it - this will
prove the name exists in the fortran variable.

Then trace backwards to where the variable gets set from the input parameters.

It has been a long time since I've used fortran, and I'm not familiar with how the
CLI parameter list gets translated into fortran strings.
Reply With Quote
  #3  
Old 30th April 2010, 03:35 PM
oclinux Offline
Registered User
 
Join Date: Apr 2010
Posts: 2
linuxsafari
Re: Fortran Programs and long path names input's

@jpollard

Yeah i know that the bash limits cant cause the problem. So after the tests i change back the limits.h to maintain the system default options ,and because i wrote a little bash scripts and execute with longpaths names (and they run well...).

I forgot to say that i dont have access to the source code of my fprogram ( at least for the next few hours, until i download then hehe). They r already compied.

As i said, its because of the longpath name, because if i copied the input file to a folder and the fprogram to the same, and run , the file can be read.

(But, i will download the code to try debug this...)

If anyone have others thoughts , plz let me know
Reply With Quote
  #4  
Old 30th April 2010, 03:40 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: Fortran Programs and long path names input's

That is odd. It almost sounds like you should have gotten a runtime error where
a short string was assigned a long string....

Or - and I think this is more likely, the runtime copy of the parameter into a fortran
string didn't complete because the fortran string was too short.

If the program didn't check for this, then it is possible that the copy wasn't done,
leaving the file name empty.

If you like to test - you can try different name lengths my moving up the directory
tree (or creating subdirectories and moving the "working" filename into the
subdirectory... Repeat until it quits.. This will give you a good hint of what the string
limit is (if it works for ..fprogram file, try ...fprogram a/file, then ...fprogram b/a/file
..)

It sounds to me like a bug in the program.
Reply With Quote
Reply

Tags
fortran, input, long, names, path, programs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add path /usr/local/bin/lftp to user path nix4me Using Fedora 6 18th August 2010 12:31 AM
Path names in Python MuadNu Programming & Packaging 4 2nd April 2009 05:55 AM
Looking up DNS names takes too long. pinenut Servers & Networking 8 8th November 2007 05:53 AM
what is the default programs installation path in linux? silentemotion Using Fedora 8 11th July 2006 11:32 AM
Long delays starting up, and starting most programs. LionKimbro Using Fedora 0 4th May 2006 03:21 PM


Current GMT-time: 22:50 (Monday, 20-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Sahaswan Photos on Instagram - Seohara - Phan Thong Instagram Photos