Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using NAS
06-28-2010, 05:12 PM, (This post was last modified: 06-28-2010, 05:14 PM by Vault.)
#1
Using NAS
Hi,

i'm in a windows environment, using a NAS as Storage.

My NAS is named 'nas1', and if pointing to that nas like '//nas1/dms/documents/' (UNC-Naming) some strange things happen and an error occurs, no document is stored while uploading, resp. stored in the app-path itself?

So i modified the 'inc.FileUtils.php' reading like this:

************************************************
function makeDir($path)
{
#modification start
if(substr($path,0,6)=='//nas1')
{
mkdir($path,0777,true);
return true;
}
#modification end


if (strncmp($path, DIRECTORY_SEPARATOR, 1) == 0) {
$mkfolder = DIRECTORY_SEPARATOR;
}
else {
$mkfolder = "";
}
$path = preg_split( "/[\\\\\/]/" , $path );
.....

************************************************

Ok, i first want to hear if this isn't good using mkdir this way.
If no complaints than i will do some more work on it.

Regards


Jörg
Reply
07-15-2010, 03:53 PM,
#2
RE: Using NAS
It seems like you patch will work only for your specific case (the path must start with "\\nas1") Can you provide a more general patch (or at least test deeply the problem)?

What kind of strange thigs happens?

Could ths problem be due to the "\\" starting path? In this case the problem should affect every windows share.

I don't use NAS but don't think they're so different from a regular shared partition.

Let us know,
Matteo
Reply
07-15-2010, 04:14 PM, (This post was last modified: 07-15-2010, 04:19 PM by Vault.)
#3
RE: Using NAS
Hi matteo,

as i wrote it wasn't possible to point to an other Resource using an UNC-Path like '\\nas1\dms\documents\' or '//nas1/dms/documents/'.

The first two slashes have been handled not correct, so at the end my documents resided in the path of the installation of my dms, locally, beneath
a 'nas1/dms/documents/1048576'-Folder, and so on.

You understand?

The documents were not saved on the NAS but locally!
It worked out that the saveing-routine has a problem, the (i call it) path translation in it.

And, of course, they will never be found, because reading the documets the path points to the NAS, but no documents there!
And the reading routine does no path-translation.

And, of course, the code i posted is absolutely specific to me.
I posted it to demonstrate what happend at my side.

And the question was why not use 'mkdir($path,0777,true);' at all, but juggling with every single folder in the path while saving.

So, i would like to replace the makeDir-Function like this:


function makeDir($path)
{
mkdir($path,0777,true);
return true;
}



Regards

Jörg
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)

Contact Us | LetoDMS Community Forum | Return to Top | | Lite (Archive) Mode | RSS Syndication