Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
258ad38f
Commit
258ad38f
authored
Apr 10, 2013
by
Robin Appelman
Browse files
Fix touch for creating new files
parent
48dabd2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/files/storage/local.php
View file @
258ad38f
...
@@ -95,7 +95,7 @@ class Local extends \OC\Files\Storage\Common{
...
@@ -95,7 +95,7 @@ class Local extends \OC\Files\Storage\Common{
// sets the modification time of the file to the given value.
// sets the modification time of the file to the given value.
// If mtime is nil the current time is set.
// If mtime is nil the current time is set.
// note that the access time of the file always changes to the current time.
// note that the access time of the file always changes to the current time.
if
(
!
$this
->
isUpdatable
(
$path
))
{
if
(
$this
->
file_exists
(
$path
)
and
!
$this
->
isUpdatable
(
$path
))
{
return
false
;
return
false
;
}
}
if
(
!
is_null
(
$mtime
))
{
if
(
!
is_null
(
$mtime
))
{
...
...
tests/lib/files/storage/storage.php
View file @
258ad38f
...
@@ -257,4 +257,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
...
@@ -257,4 +257,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$content
=
stream_get_contents
(
$fh
);
$content
=
stream_get_contents
(
$fh
);
$this
->
assertEquals
(
file_get_contents
(
$textFile
),
$content
);
$this
->
assertEquals
(
file_get_contents
(
$textFile
),
$content
);
}
}
public
function
testTouchCreateFile
(){
$this
->
assertFalse
(
$this
->
instance
->
file_exists
(
'foo'
));
$this
->
instance
->
touch
(
'foo'
);
$this
->
assertTrue
(
$this
->
instance
->
file_exists
(
'foo'
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment