Skip to content

Commit

Permalink
remove sync service method
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanniser committed Feb 1, 2025
1 parent f70f494 commit 481908e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion .changeset/spicy-pumas-kneel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"@effect/platform": patch
---

Addition of the `sync` function to `FileSystem.FileSystem` and `sync` property to `FileSystem.File` representing the `fsync` syscall.
Addition of `sync` property to `FileSystem.File` representing the `fsync` syscall.
12 changes: 0 additions & 12 deletions packages/platform-node-shared/src/internal/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,17 +508,6 @@ const symlink = (() => {
return (target: string, path: string) => nodeSymlink(target, path)
})()

// == sync

const sync = (() => {
const nodeSync = effectify(
NFS.fsync,
handleErrnoException("FileSystem", "sync"),
handleBadArgument("sync")
)
return (fd: FileSystem.File.Descriptor) => nodeSync(fd)
})()

// == truncate

const truncate = (() => {
Expand Down Expand Up @@ -636,7 +625,6 @@ const makeFileSystem = Effect.map(Effect.serviceOption(FileSystem.WatchBackend),
rename,
stat,
symlink,
sync,
truncate,
utimes,
watch(path) {
Expand Down
7 changes: 0 additions & 7 deletions packages/platform/src/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,6 @@ export interface FileSystem {
fromPath: string,
toPath: string
) => Effect.Effect<void, PlatformError>
/**
* Synchronize a file's in-memory state with the on-disk state.
* This ensures that all file system updates for the file are written to the storage device.
*/
readonly sync: (
fd: File.Descriptor
) => Effect.Effect<void, PlatformError>
/**
* Truncate a file to a specified length. If the `length` is not specified,
* the file will be truncated to length `0`.
Expand Down
3 changes: 0 additions & 3 deletions packages/platform/src/internal/fileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ export const makeNoop = (
symlink(fromPath) {
return Effect.fail(notFound("symlink", fromPath))
},
sync(fd) {
return Effect.fail(notFound("sync", fd.toString()))
},
truncate(path) {
return Effect.fail(notFound("truncate", path))
},
Expand Down

0 comments on commit 481908e

Please sign in to comment.