Long network drive = file not exist!?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Long network drive = file not exist!?

Post by macroman » Sun Oct 30, 2016 4:05 am

Code: Select all

Let>testfile=F:\public_html\trending\Wisconsin Badgers football‬kaka ‪Nebraska Cornhuskers football‬kaka ‪Big Ten Conference‬‬.us
IfFileExists>%testfile%
mdl>hi
Endif
I can see that file with my own eyes, but MS can't see it... it returns not exist.... drive F is a network mounted drive...

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long network drive = file not exist!?

Post by Grovkillen » Sun Oct 30, 2016 12:05 pm

You might need to put quotes around it.
Let>ME=%Script%

Running: 15.0.27
version history

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Long network drive = file not exist!?

Post by macroman » Sun Oct 30, 2016 7:42 pm

I have tried/done that as well... no luck

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: Long network drive = file not exist!?

Post by Djek » Mon Oct 31, 2016 10:14 am

hey Macroman,

cheer up, youre not alone... :D
i've mapped a networkshare to F:
I ve create the same file and folders...
Then i ran the script, and also noticed the file i see in the folder,(also in DOS) but MS doesnot detect it.
I then created a Wisconsin.us in the folder and stil no detection.
I ve renamed the long file Wisconsin Badgers footballkaka Nebraska Cornhuskers footballkaka Big Ten Conference.us
into GGHHWisconsin Badgers footballkaka Nebraska Cornhuskers footballkaka Big Ten Conference.us
and the MS detected the file !!
And from there is like randomally detection. Sometimes it detects, but sometimes not.
Nb if ofcourse i test with test.txt it functions OK.
I can not get the clue. :shock:
My os is Win 7 pro, MS 14.2.09

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Long network drive = file not exist!?

Post by Grovkillen » Mon Oct 31, 2016 12:14 pm

What does the GetFileList> give you?
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: Long network drive = file not exist!?

Post by Djek » Mon Oct 31, 2016 12:28 pm

yes

GetFileList>F:\public_html\trending\*.us,uitvoer,;

but also the
GetFileList>F:\public_html\trending\*.*,uitvoer,;

finds the long filename

strange...well it's Halloween somewhere... :evil:

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Long network drive = file not exist!?

Post by JRL » Mon Oct 31, 2016 12:56 pm

Like Djek I set up the path and file on my 2008 server and IfFileExists> works as advertised. Also set up the path and file then created a network drive letter to a Windows 7 machine and IfFileExists> still works. What is the OS of the computers you're linking to? I have read that there may be issues with Samba and long file names. (Google "Samba long file names")

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Re: Long network drive = file not exist!?

Post by Djek » Mon Oct 31, 2016 1:00 pm

wel im using a Synology nas as a data server.
I do not know if it is Samba , but sure not Windows OS

update 1-11
tested with a share to another Win7 pro pc,
mapped to F:

it still cannot find the long =F:\public_html\trending\Wisconsin Badgers football‬kaka ‪Nebraska Cornhuskers football‬kaka ‪Big Ten Conference‬‬.us
GetFileList get the file.

but im now almost sure it has to do with the OS and not with MS because now the short F:\public_html\trending\Wisconsin.us is now steady detected with IfFileExists.

I dont get it.

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Long network drive = file not exist!?

Post by macroman » Wed Nov 02, 2016 11:41 am

I'm using netdrive.net to mount my drives... works great if the names are shorter... i can access it just fine in windows explorer...

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Long network drive = file not exist!?

Post by JRL » Wed Nov 02, 2016 3:37 pm

Using NetDrive to mount your drives adds a whole new layer of uncertainty. Who knows what unorthodox programing they use to provide drive letters to FTP sites. If Windows Explorer can see the file I would hope that DOS "dir: can also see the file. I would try something like:

Code: Select all

Let>testfile=F:\public_html\trending\Wisconsin Badgers football‬kaka ‪Nebraska Cornhuskers football‬kaka ‪Big Ten Conference‬‬.us

Let>RP_Wait=1
Let>RP_Windowmode=0
RunProgram>cmd /c dir "%testfile%" /b > %temp_dir%testfile_test.txt

FileSize>%temp_dir%testfile_test.txt,vTestSize
DeleteFile>%temp_dir%testfile_test.txt
If>vTestSize>0
  MDL>Hi
EndIf

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Long network drive = file not exist!?

Post by macroman » Wed Nov 02, 2016 7:36 pm

yes, Dos and everything else can see it - even my plex can read stuff from a drive that was mounted by this obnoxious app (netdrive)... even getfilelist in MS can see it... just not the function (IfFileExists)... question is, why everything inside MS can see/read/delete even execute but not ifFileexists?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Long network drive = file not exist!?

Post by Marcus Tettmar » Thu Nov 03, 2016 4:03 pm

IfFileExists uses the same internals as GetFileList etc, so I'm rather baffled here. Can''t see any reason why it wouldn't see it. Unless of course it isn't there. Could you be calling it too soon/too late? It might not be an issue with IfFileExists but more a case of WHEN you call it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts