Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_fileexists() on mapped drive Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 212
Posted: September 30 2017 at 18:11 | IP Logged Quote gg102

I seem to have found a possible bug.

The function ph_fileexists() functions seems to work nicely on a "local" drive, but doesn't seem to work on a mapped drive.

ph_fileexists( "r:\home\pi\www\file.log" )
Where r: is a mapped drive

I'm (unfortunately) using windows 10, and yes, I can fully access the drive in other apps, and programs and standard windows UI.

Does anyone use this function on a mapped drive?





Back to Top View gg102's Profile Search for other posts by gg102
 
nick7920
Senior Member
Senior Member


Joined: March 04 2008
Location: United States
Online Status: Offline
Posts: 193
Posted: October 01 2017 at 10:01 | IP Logged Quote nick7920

did you try using FQDN (fully qualified domain name)

I had problem with Mapping with windows itself that
sometime on reboot wont be available . (that was in
win7)

been using win 10 for while now and I use FQDN to
reference the mapped drive.

I am using to do backups for example

ph_backupdb("\\WDMYCLOUD\Public\Util\POWERHOME\database\
"+string(today(),"yyyymmddmmss")+".db",0)

Nick
Back to Top View nick7920's Profile Search for other posts by nick7920
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 212
Posted: October 02 2017 at 13:10 | IP Logged Quote gg102

Nick,

Thank you for your suggestion. In this case, I'm on a local net, trying to check the status of a file on a Raspberry Pi.
There isn't a domain, but I did try using the full server name.

I did try:
ph_fileexists( "//192.168.x.xxx/home/pi/file.ext")
and
ph_fileexists( "\\192.168.x.xxx\home\pi\file.ext")
and all the variants.

I also tried using the Raspberry Pi WINS/DNS name, "raspberrypi" with no joy.

I am currently working to map a windows drive onto the Raspberry pi so it can be "local" to PH. That will work, but I
would prefer to NOT to map the Windows drive to the Raspberry Pi as that opens a security risk on the PH machine that I'd
prefer to not have. I'd prefer that the Pi be vulnerable to hacks than the PH machine. Oh well......

Thanks for your suggestion, it was a good one!

Back to Top View gg102's Profile Search for other posts by gg102
 
nick7920
Senior Member
Senior Member


Joined: March 04 2008
Location: United States
Online Status: Offline
Posts: 193
Posted: October 05 2017 at 20:46 | IP Logged Quote nick7920

I have couple of Linux box but none shared.

also look into and search for windows when User Account
Control (UAC) is enabled map drive not available in some
application.
"UAC treats members of the Administrators group as
standard users"

other idea is to run batch file and if file found copy
to local and so on . run batch file from PH before you
check for file from local now.   

Just another idea.
good luck

Nick
Back to Top View nick7920's Profile Search for other posts by nick7920
 
nick7920
Senior Member
Senior Member


Joined: March 04 2008
Location: United States
Online Status: Offline
Posts: 193
Posted: October 08 2017 at 14:00 | IP Logged Quote nick7920

I tried on one of my linux based router and it worked
correctly directly without mapping command on win 10.

also worked with or without hostname

ph_fileexists("\\GL-AR300M\sda1\test.txt")
ph_fileexists("\\10.0.xxx.xxx\sda1\test.txt")

files are is shared by samba install on the router.

I hope this helps

Nick
Back to Top View nick7920's Profile Search for other posts by nick7920
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 212
Posted: October 08 2017 at 14:44 | IP Logged Quote gg102

Nick,

That's very interesting. I'll need to seriously
investigate the Samba congif. I'm not a Unix/Linux
guy so I could easily have something wrong there. I
can read and write to the drive/file, but for some
reason PH couldn't sense ph_fileexists(). This one
might take a while to find now. Your findings are
important. I'll also have to re-investigate if there's
something special about the Raspberry Pi version of
Samba.

Thanks for the update. This one's going to take a
while..

Back to Top View gg102's Profile Search for other posts by gg102
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4421
Posted: November 09 2017 at 13:47 | IP Logged Quote dhoward

gg,

I can confirm it works for me on my mapped QNAP NAS drive. However, I'll try to do some testing on my Raspberry Pi and see what I can do to get it working.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 212
Posted: November 09 2017 at 14:10 | IP Logged Quote gg102

Dave,
Thank you, and again, thank you for all your efforts.

You've been busy today!

I have built a work around for this, I write the file from the RPi directly to the PH machine,
and that works nicely.

Since this is a stable work around, I'd say, to move this DOWN on the list. For me, it's
still not working, but it's NOT important now; besides, it might very well be a configuration
with my implementation of Samba.



Back to Top View gg102's Profile Search for other posts by gg102
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

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