Closed nbriggs closed 2 years ago
Does the disk device call a different entry into the Maiko code, or just behaves differently when it gets there.
At the \UFSOpenFile Lisp level, it could extract the directory from the filename, execute the directorynamep method, and then switch to dsk if that fails.
We could also add a separtate “insuredirectory” method.
On May 24, 2022, at 1:02 PM, Nick Briggs @.***> wrote:
There's currently no reasonable way to create a file on the {UNIX} device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the {DSK} device.
The feature would need to be implemented in the maiko emulator C code.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJJWRX4HSXNVOUEJUF3VLUYWPANCNFSM5W2XFBGA. You are receiving this because you are subscribed to this thread.
It's fixed in the branch referenced by the PR -- it all goes through the same C code and just looked at whether the hostname was DSK or UNIX and behaved differently. Now the difference (in that piece of the code) is whether it sets the flag that causes it to try to manage the hard-links and version numbers.
I know we’re fans of DWIM but I would argue that creating a file in a nonexistent directory should result in an error. This is consistent behavior with other applications and less likely to result in surprises.
On May 24, 2022, at 2:02 PM, Nick Briggs @.***> wrote:
There's currently no reasonable way to create a file on the {UNIX} device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the {DSK} device.
The feature would need to be implemented in the maiko emulator C code.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DEMR2MFOJFWI7I5OZLVLUYWRANCNFSM5W2XFBGA. You are receiving this because you are subscribed to this thread.
This is the way DSK and other Medley file systems have always behaved, Unix was the outlier.
If this behavior is uniformly withdrawn from all file devices, then we would need to add another file-device interface function (like mkdir) that allows the creation of subdirectories from inside Medley, without going out to a shell. And openstream would fail if that hadn’t been called first.
On May 24, 2022, at 7:19 PM, Arun Welch @.***> wrote:
I know we’re fans of DWIM but I would argue that creating a file in a nonexistent directory should result in an error. This is consistent behavior with other applications and less likely to result in surprises.
On May 24, 2022, at 2:02 PM, Nick Briggs @.***> wrote:
There's currently no reasonable way to create a file on the {UNIX} device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the {DSK} device.
The feature would need to be implemented in the maiko emulator C code.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DEMR2MFOJFWI7I5OZLVLUYWRANCNFSM5W2XFBGA. You are receiving this because you are subscribed to this thread.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136643051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJIQRAAM2TOX7W3FHY3VLWE3BANCNFSM5W2XFBGA. You are receiving this because you commented.
I don’t disagree that this is how it’s always worked, I just think it’s problematic. For example, if I have a typo in the directory name it creates a whole new directory and puts the file there.
On May 24, 2022, at 8:30 PM, rmkaplan @.***> wrote:
This is the way DSK and other Medley file systems have always behaved, Unix was the outlier.
If this behavior is uniformly withdrawn from all file devices, then we would need to add another file-device interface function (like mkdir) that allows the creation of subdirectories from inside Medley, without going out to a shell. And openstream would fail if that hadn’t been called first.
On May 24, 2022, at 7:19 PM, Arun Welch @.***> wrote:
I know we’re fans of DWIM but I would argue that creating a file in a nonexistent directory should result in an error. This is consistent behavior with other applications and less likely to result in surprises.
On May 24, 2022, at 2:02 PM, Nick Briggs @.***> wrote:
There's currently no reasonable way to create a file on the {UNIX} device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the {DSK} device.
The feature would need to be implemented in the maiko emulator C code.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DEMR2MFOJFWI7I5OZLVLUYWRANCNFSM5W2XFBGA. You are receiving this because you are subscribed to this thread.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136643051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJIQRAAM2TOX7W3FHY3VLWE3BANCNFSM5W2XFBGA. You are receiving this because you commented.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136649929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DHDMBBE2IFQ2G5WVCDVLWGDFANCNFSM5W2XFBGA. You are receiving this because you commented.
Closed by Interlisp/maiko#422
Is a typo in a directory any different than a typo in the file name or extension? You could just as easily screw up a mkdir command: “mkdir fooo” vs “mkdir “foo” (followed by “cd fo
To put it another way, is an unexpected “whole new directory” any more problematic than a whole new file, other than that intuitively it seems to be more onerous to fix it if/when you notice the mistake (which is perhaps a circularity because of the way the Unix commands operate on directories).
On May 24, 2022, at 7:47 PM, Arun Welch @.***> wrote:
I don’t disagree that this is how it’s always worked, I just think it’s problematic. For example, if I have a typo in the directory name it creates a whole new directory and puts the file there.
On May 24, 2022, at 8:30 PM, rmkaplan @.***> wrote:
This is the way DSK and other Medley file systems have always behaved, Unix was the outlier.
If this behavior is uniformly withdrawn from all file devices, then we would need to add another file-device interface function (like mkdir) that allows the creation of subdirectories from inside Medley, without going out to a shell. And openstream would fail if that hadn’t been called first.
On May 24, 2022, at 7:19 PM, Arun Welch @.***> wrote:
I know we’re fans of DWIM but I would argue that creating a file in a nonexistent directory should result in an error. This is consistent behavior with other applications and less likely to result in surprises.
On May 24, 2022, at 2:02 PM, Nick Briggs @.***> wrote:
There's currently no reasonable way to create a file on the {UNIX} device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the {DSK} device.
The feature would need to be implemented in the maiko emulator C code.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DEMR2MFOJFWI7I5OZLVLUYWRANCNFSM5W2XFBGA. You are receiving this because you are subscribed to this thread.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136643051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJIQRAAM2TOX7W3FHY3VLWE3BANCNFSM5W2XFBGA. You are receiving this because you commented.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136649929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBP2DHDMBBE2IFQ2G5WVCDVLWGDFANCNFSM5W2XFBGA. You are receiving this because you commented.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/779#issuecomment-1136664741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJIV2PR3X6KQINLFIGLVLWIDXANCNFSM5W2XFBGA. You are receiving this because you commented.
There's currently no reasonable way to create a file on the
{UNIX}
device in a directory that does not already exist. If a file is opened with parameters that would result in the file's being created if it does not already exist then any missing directories in the path should also be created. This is how it already works for the{DSK}
device.The feature would need to be implemented in the maiko emulator C code.