forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IOSTAT error 146

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Mon Sep 05, 2016 3:11 pm    Post subject: IOSTAT error 146 Reply with quote

When i try to open a file via a network mount point, i get an error 146. Opening via its equivalent \\UNC path works.

e.g.
with Z: mounted as '\\server\mountable'

OPEN (LU, FILE='Z:\data\file.txt', STATUS='OLD', ERR=80, IOSTAT=IOS)

fails

but

OPEN (LU, FILE='\\server\mountable\data\file.txt', STATUS='OLD', ERR=80, IOSTAT=IOS)

works.

is this a known issue?

K
Back to top
View user's profile Send private message Visit poster's website
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Tue Sep 06, 2016 1:37 pm    Post subject: Reply with quote

ok, i think i've found a workaround...

in a Cmd/DOS box (possibly as admin) type:

mklink /d "c:\share" "'\\server\mountable"

then this works:

OPEN (LU, FILE='c:\share\data\file.txt', STATUS='OLD', ERR=80, IOSTAT=IOS)

K
Back to top
View user's profile Send private message Visit poster's website
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Thu Sep 08, 2016 1:53 pm    Post subject: Reply with quote

...but i will still need a solution to the original issue since our client needs to get written permission signed in triplicate (sent in, sent back, queried, lost, found, subjected to public inquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters.) before he can use the mklink command.

K
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Thu Sep 08, 2016 7:45 pm    Post subject: Reply with quote

OPEN leads to a call to the Microsoft API function CreateFile. The error is reported via GetLastError() and the value 146 means "The path specified is being used in a substitute".

I don't have any further information at the moment.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri Sep 09, 2016 1:12 am    Post subject: Reply with quote

Kenny,

What does "INQUIRE (UNIT=LU, NAME=FILE_NAME)" return for the different naming cases you are considering?
This may give an indication of what is best to use.

FTN95 is good in this regard, as it gives a full tree name for when I use INQUIRE, unlike other compilers that only give the local file name.

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Fri Sep 09, 2016 7:29 am    Post subject: Reply with quote

It may be possible to use the Windows API function WNetGetConnection in order to get the full path and this could be written into the FTN95 I/O library but there are two problems with this.

1) I am not sure that this is the right function to use and
2) WNetGetConnection has the following limitation.

"If the network connection was made using the Microsoft LAN Manager network, and the calling application is running in a different logon session than the application that made the connection, a call to the WNetGetConnection function for the associated local device will fail."
Back to top
View user's profile Send private message AIM Address
KennyT



Joined: 02 Aug 2005
Posts: 317

PostPosted: Fri Sep 09, 2016 8:50 am    Post subject: Reply with quote

I've done some more testing...

if the program is started from a DOS box it fails with a 146
if it's started by double-clicking it from a Windows file browser it works!

further, the DOS box itself doesn't know anything about the Z: drive

so, i tried using the "net use y: \\server\mountable" command and that works for the DOS box, but the windows file browser doesn't know about the Y drive! So i tried "net use z: \\server\mountable" and now both methods work!!!

so, it appears that "mount network drive" from a Windows file browser and "net use" from a DOS box don't know about each others' drive letters!

so, what i will ask the client to try is to duplicate his Z: drive mapping using "net use" and see if that works...


John, the failure filename that is reported by the INQUIRE command is the "Z:" version - not the "\\server"

K
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group